Level won't display properly with any script...

Posted By: Galen

Level won't display properly with any script... - 12/02/06 18:42

This is related to some other issued I've had with my level...

In any case, if I build my level (which has many entities) and "preview" it, it looks fine--all entities and blocks and models are there, all textures appear as they should, etc. When I "run" the level, again, everything looks normal as long as I don't have a script attached to the level (as determined in the MAP properties). As soon as I attach a script, however (among others, I tried the "walkthrough" template script), most of my entities and blocks don't show and most of the level is black; I can move the camera, but it is extremely sluggish. My level/world is rather large and complex with many items, but I don't get any errors telling me that there are too many.

Can anyone tell me what might cause this to happen?

And is there a way to essentially duplicate the level "preview" mode with a script (because that at least works).

Thanks.
Posted By: Galen

Re: Level won't display properly with any script.. - 12/05/06 00:11

Nobody has any ideas?

Would it help if I posted screenshots?
Posted By: JazzDude

Re: Level won't display properly with any script.. - 12/05/06 01:25

It sounds like you may be missing some required scripts. Why don't you post the list shown in the project manager.
Posted By: Galen

Re: Level won't display properly with any script.. - 12/05/06 13:15

Okay, I'll post what I have when I get home from work tonight. Thank you for the suggestion!
Posted By: Galen

Re: Level won't display properly with any script.. - 12/05/06 22:59

Okay, here's a Word document with screenshots and script info:
My Project
It's about 3 & 1/2 MB download for the file.

The first few screenshots show what the level looks like when run without a script (same as preview mode). Then I show that I am adding a basic walkthrough template script. Then follows the script itself, as generated by 3DGS, then a screenshot of what the level looks like when run with this script--notice that only some windows and a sculpture are showing, otherwise all is black; I know I have many entities in my level--all of which display just fine when I build and run them on their own. Then the build log from the last build.

If anyone can point out why this is happening, I'd be grateful. At this point, I'd even be willing to upload or email my project to Conitec in case they were interested in figuring out where I'm going wrong, but I know that's not their job. Maybe someone here can figure it out from the file above. I can post more info--I just need to know what's needed. Thanks!
Posted By: Galen

Re: Level won't display properly with any script.. - 12/06/06 23:23

Neglected to mention that the template file included its own scripts...
Posted By: PHeMoX

Re: Level won't display properly with any script.. - 12/07/06 03:15

Mmmm, in Preview mode everything looks like it should be? I think there's a script somewhere which sets a different setting for camera.clip_near and camera.clip_far , that's currently my guess .. If the preview works, then it must be the script, that's no doubt the problem,

Cheers
Posted By: Galen

Re: Level won't display properly with any script.. - 12/07/06 18:49

This is the default "walkthrough" template script though--I haven't done anything to change it. If I have no script attached, it looks fine (of course, that's useless, but it still *looks* fine). So that must mean there's something wrong with the template scripts...? I'm thinking maybe there's an issue with the engine not being able to load large entities properly (and when there are many entities).

What's the main difference between "preview" mode and a default "script" mode? I mean, what kind of "template" does preview mode use to display, and why would it work?
Posted By: Galen

Re: Level won't display properly with any script.. - 12/09/06 05:29

Does anyone by any chance have a sample script that they know will work with a large level with many entities? It could just be a simple camera walk-through script, but something I could test with (see the file posted above for exact build info, FYI). I find it hard to believe I'm the only one who's experienced this...
Posted By: alphaindigo

Re: Level won't display properly with any script.. - 12/10/06 18:51

try ading the basic a5 template script...
instead of the ones you are using at the moment
Posted By: Galen

Re: Level won't display properly with any script.. - 12/11/06 04:16

Okay, I'll give it a try tomorrow after work and post again with my result.
Posted By: Nowherebrain

Re: Level won't display properly with any script.. - 12/11/06 04:18

is it set to run with a different nexus value under preview?, how many entities are we talking about?, sorry, I cannot download your .doc(not your fault, this computer is wierd sometimes).
Posted By: Galen

Re: Level won't display properly with any script.. - 12/11/06 23:14

The nexus value is the same: 500.

I have 93 portals
1234 objects
level size 6850 units
103 vertices
90 visible surfaces
9 textures
1021 kb texture space
31 regions

Granted, most of those "objects" are pre-compiled entities (some models and some sprites, but mostly entities).
Takes like 1 second for my level to compile.

I tried the other template files and had no luck--they all loaded with most of my objects missing from the screen and a whole lot of black emptiness between the few objects I did see (strangely, one template mentioned loading 7 objects, another template mentioned 21).
Posted By: Galen

Re: Level won't display properly with any script.. - 12/12/06 18:57

Anyway, here's what I see (3D window) in the preview or scriptless "run", which is how it should look:



And here's what I get if I attach any script at all to the build, then run it:




Posted By: Galen

Re: Level won't display properly with any script.. - 12/13/06 18:57

Is there any way to exactly duplicate the "preview" mode via a script?
Posted By: nipx

Re: Level won't display properly with any script.. - 12/13/06 19:38

ask conitec....

(looks very good btw )

nipx
Posted By: Galen

Re: Level won't display properly with any script.. - 12/13/06 22:53

Thanks! The colors are even a little off in the screenshot, and it actually looks better than that.

I was hoping Doug or JCL would have some advice on what the problem might be, or on how I could work to to narrow down the possibilites of what's causing it. I'd even be willing (happy, actually) to either ftp my project to them, or snail-mail it (on my dollar) on CD to them if they wanted to take a look that way. Hopefully they'll notice this thread...
Posted By: Galen

Re: Level won't display properly with any script.. - 12/15/06 03:22

So nobody has seen anything like this before?
Posted By: PHeMoX

Re: Level won't display properly with any script.. - 12/15/06 09:23

Nope, I haven't had any problems like that, but then again I'm not using map entities most of the time. If you like, you can PM me a download link to your project and I could take a look at it, I still think it's a camera.clip_near , camera.clip_far issue, eventhough it could be something else.

By the way, not that it really should matter, but preview mode uses the standard amount of nexus, which is not 500, unless I've missed a new feature.

Cheers
Posted By: Thomas_Nitschke

Re: Level won't display properly with any script.. - 12/18/06 15:48

Sounds as if the script were missing some paths and thus unable to load all the map entities.
Assuming you indeed have your map entities organized in subfolders, you could try and open up your main script, then add some path "xyz" statements at its top, where xyz is the name of the subfolder with all the map entities in it.
Posted By: Galen

Re: Level won't display properly with any script.. - 12/19/06 23:52

Quote:

Sounds as if the script were missing some paths and thus unable to load all the map entities.
Assuming you indeed have your map entities organized in subfolders, you could try and open up your main script, then add some path "xyz" statements at its top, where xyz is the name of the subfolder with all the map entities in it.




This didn't seem to have any effect:

////////////////////////////////////////////////////////////////////////
// A6 "Walk Thru" Project wdl:
// Created by WED.
////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////
// The PATH keyword gives directories where template files can be found.
path "C:\\Program Files\\GStudio6\\template_6"; // Path to A6 templates directory
path "C:\\Program Files\\GStudio6\\template_6\\code"; // Path to A6 template code subdirectory
path "C:\\Program Files\\GStudio6\\template_6\\images"; // Path to A6 template image subdirectory
path "C:\\Program Files\\GStudio6\\template_6\\sounds"; // Path to A6 template sound subdirectory
path "C:\\Program Files\\GStudio6\\template_6\\models"; // Path to A6 template model subdirectory
path "C:\\Program Files\\GStudio6\\work"; //where all my entities are

/////////////////////////////////////////////////////////////////
// Filename of the starting level.
string level_str = <GLMain.WMB>; // give file names in angular brackets

////////////////////////////////////////////////////////////////////////////
Posted By: Galen

Re: Level won't display properly with any script.. - 12/20/06 00:15

Quote:

Nope, I haven't had any problems like that, but then again I'm not using map entities most of the time. If you like, you can PM me a download link to your project and I could take a look at it, I still think it's a camera.clip_near , camera.clip_far issue, eventhough it could be something else.

By the way, not that it really should matter, but preview mode uses the standard amount of nexus, which is not 500, unless I've missed a new feature.

Cheers




I tried changing the nexus to various sizes, and it didn't help. It did indicate at one point though when i set it too low that I needed space for 750 entities, but that was the only semi-meaningful message I saw.

Do you know where I'd be able to upload about 700MB worth of data to?
Posted By: Galen

Re: Level won't display properly with any script.. - 12/22/06 00:13

Seriously, anyone, any ideas? This level doesn't want to load regardless of what directories are referenced, and I've tried a bunch of different variations of the script file, and nothing works. It loads fine in preview mode, and loads fine with no level script, but as soon as I attach a level script--any of the A6 template scripts, the level will not load properly.

I've uploaded the level files, so if someone at Conitec is curious to see what's going on and would like to take a peek (Doug or JCL?) I'd be happy to PM the download link...
Posted By: Thomas_Nitschke

Re: Level won't display properly with any script.. - 12/23/06 19:29

I'd still assume that there be something wrong with the paths. Although your setup looks quite okay, I'd at least have a try and simlpy copy all the map-entities into the same folder your level is in. Then simply open up your .WMP in Notepad and do a quick search-and-replace to correct all the map-entities' file paths. Open your level in WED again, recompile it completely and finally have another try.
Currently, that's the only reason I could think of... if this problem were related to the nexus, A6 sure would spit out an error message.
Posted By: Galen

Re: Level won't display properly with any script.. - 12/30/06 19:48

I checked the .wmp file, and all the folder/directory paths appear to be fine. All my entities and models are in the same directory as my level file already anyway.
Posted By: Thomas_Nitschke

Re: Level won't display properly with any script.. - 12/30/06 21:33

Alright, I suppose that's out of the range of possibilities then.
The only other things that currently come to my mind are materials and origins. If you have any material effects (i.e. FFP effects or shaders) applied to your entities, I'd try to disable them in order to track down the problem. As for the origins: You might want to check the origins of your entities - if they are in a position to close to the camera, I think it likely that the whole entity might be clipped. I suppose I don't have to go into detail since you seem to know 3dgs's basics
But if I were you, I'd make sure all the origins are in the right place.

Currently, that's all I can come up with... keep us posted
Posted By: Galen

Re: Level won't display properly with any script.. - 12/30/06 23:45

I don't have any effects or shaders applied anywhere, so I guess I can check the origins thing, though there are plenty of entities that *should* be visible then according to that theory, since the camera is far enough back that it shouldn't be touching anything anyway (and I've tried from various camera positions already, with no effect)...
Posted By: Thomas_Nitschke

Re: Level won't display properly with any script.. - 12/31/06 13:59

Regarding the origins issue, you could also try to find out whether fiddling with your camera's clip range does anything... I'd probably set a really huge clip range just to be sure nothing gets clipped.
Posted By: Galen

Re: Level won't display properly with any script.. - 01/01/07 22:36

Okay, I installed the 6.50.4 update, and now when I try to run the level with a script file attached, I actually get an error message before I see the messed-up 3D engine window view. It says "Malfunction W1508" and "Can't load". It doesn't say what it can't load, though according to the manual supposedly I'm trying to load a saved game or an info file from another game/project, but I don't see how that's possible since I'm using the basic walk-through script file as my level's main script file, unaltered. Can this error mean anything else? Is it indicative of some other error?
Posted By: FixxeR

Re: Level won't display properly with any script.. - 01/02/07 07:52

Well, this might be a long shot but, do you have a map entity inside of a map entity? The engine will (strangely) spit that error out if you do.

FixxeR
Posted By: Galen

Re: Level won't display properly with any script.. - 01/02/07 17:08

Ah.... when you say "inside", how exactly do you mean?
For example, I have a building and all its walls, floors, roof, built as a single entity. Then, I have the windows built as separate entities, and then in my main level, I have the building entity loaded, and then I have the window entities loaded and placed in the open window frames of the building entity. Is that what you mean? Or do you mean if I "built" an entity on its own that had another pre-built entity included in that build, and THEN tried using that combination in my level? If you mean the former example, then I'm not sure 3DGS is going to work for my project if I can't load pre-built pieces of my building like that, but if you mean the latter, I might be able to track down the extra entity in question and revise my build.
Thing is, it all works fine in preview mode. This really is a stumper.
Posted By: FixxeR

Re: Level won't display properly with any script.. - 01/02/07 18:28

I mean that latter. Having pre-built map entities inside of another pre-built map entity. Like, say you have some chairs that you built as map entities. Now, you create a house and put those chairs in it. You then build that house (with the chairs inside) as a map entity.

If you have a map-entity inside of a map entity it'll cause your map (and A6) to act strangely, and throw the W1508 error for some rason.

Hope this'll help,
FixxeR
Posted By: Galen

Re: Level won't display properly with any script.. - 01/02/07 21:36

Okay, this put me in the right direction!

I tried systematically eliminating entities from my main level until I would no longer get an error. I believe I have narrowed it down somewhat, though this didn't get the level to run. What I *did* notice after that that I was starting to get messages indicating a certain action/material wasn't found, so I added those back to my level script, along with some directory paths for at least one texture that wasn't being found. And I had to set max_entities to a higher level.

This allowed my level to load.

However, the template script I was using had me stuck in the middle of my level with no way to move (I don't have a player model--I want to use just cameras to move), so I edited the script to take out those player model references, as well as an erroneous camera script, and this allowed me to move around with the camera in my level.

A few problems remain, however. I still need to fix those entities that aren't loading, and now that my level loads, it seems that there are more entities missing than the ones I had previously narrowed down to (and some of them are simply TGA sprites that had been loaded into the level, which I wouldn't think should go missing at all). Also, movement is very slow, especially compared to preview mode, which is pretty fast. So I need to fix these somehow...

Here is my level script file:

////////////////////////////////////////////////////////////////////////
// A6 "Walk Thru" Project wdl:
// Created by WED.
////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////
// The PATH keyword gives directories where template files can be found.
path "C:\\Program Files\\GStudio6\\template_6"; // Path to A6 templates directory
path "C:\\Program Files\\GStudio6\\template_6\\code"; // Path to A6 template code subdirectory
path "C:\\Program Files\\GStudio6\\template_6\\images"; // Path to A6 template image subdirectory
path "C:\\Program Files\\GStudio6\\template_6\\sounds"; // Path to A6 template sound subdirectory
path "C:\\Program Files\\GStudio6\\template_6\\models"; // Path to A6 template model subdirectory
path "C:\\Program Files\\GStudio6\\work"; // Path to work subdirectory
path "C:\\Program Files\\GStudio6\\work\\Exterior GL PIX\\Horizon Pix"; // Path to HPIX subdirectory
path "C:\\Program Files\\GStudio6\\work\\Exterior GL PIX\\Textures"; // Path to textures subdirectory

/////////////////////////////////////////////////////////////////
// Filename of the starting level.
string level_str = <GLMain.WMB>; // give file names in angular brackets

////////////////////////////////////////////////////////////////////////////
// Included files
include <gid01.wdl>; // global ids
include <display00.wdl>; // basic display settings
include <door01.wdl>;
include <nogouraud.wdl>;
include <sky01.wdl>;
include <tree1.wdl>;





/////////////////////////////////////////////////////////////////
// Desc: The main() function is started at game start
function main()
{
// set some common flags and variables
// freeze all entity functions
freeze_mode = 1;
// no level has been loaded yet...
gid01_level_state = gid01_level_not_loaded;

// entry: Warning Level (0,1, or 2)
// entry_help: Sets sensitivity to warnings (0 = none, 1 = some, 2 = all).
warn_level = 2; // announce bad texture sizes and bad wdl code


// entry: Starting Mouse Mode (0, 1, or 2)
mouse_mode = 0;

// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);

max_entities = 5000;

// now load the level
level_load(level_str);

wait(2); // let level load
// level should be loaded at this point...
gid01_level_state = gid01_level_loaded;

//+++ load starting values


// un-freeze the game
freeze_mode = 0;

// save start of game here
wait(6); // allow time for functions that wait for "gid01_level_loaded" to load
file_delete("start0.SAV"); // remove any old savefile
wait(1);
if( game_save("start",0,SV_ALL) <= 0)
{
diag("\nWARNING! main - Cannot save 'start' of level (ignore on restarts).");
}
else
{
diag("\nWDL: main - Game 'start' saved.");
}


// main game loop
while(1)
{
if(gid01_level_state != gid01_level_loaded)
{
freeze_mode = 1; // pause the game
while(gid01_level_state != gid01_level_loaded) { wait(1); }
freeze_mode = 0; // resume the game
}
wait(1);
}

}


// Desc: this is the function used to restart the game.
function main_restart_game()
{
// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);

// freeze the game
freeze_mode = 1;

if( game_load("start",0) <= 0)
{
diag("\nWARNING! main_restart_game - Cannot load 'start' of level.");
}
else
{
diag("\nWDL: main_restart_game - Game 'start' loaded");
}

// un-freeze the game
freeze_mode = 0;
}


// Desc: this is the function used to quit the game.
function main_quit()
{
//+++ // save global skills & strings
exit;
}


Any suggestions would definitely be appreciated, and I appreciate all the help I have gotten so far. My goal at this point is just to be able to load my level with all entities and a camera view that is acceptably fast so that I can concentrate on testing my automatic doors, etc, before moving on with finishing the level architecture...
Posted By: Galen

Re: Level won't display properly with any script.. - 01/02/07 22:42

Alright, after some more tinkering around, I've discovered something else.

If I try to run the level now, there are a bunch of models and entities that show fine in preview mode but then do not load up in Run mode.

If I delete all the content of my level at one time and try to compile, of course it won't, but then when I hit "undo" and it all comes back, if I then compile again and "Run", DIFFERENT MODELS AND ENTITIES DISAPPEAR than the ones that disappeared before removing all content and then undoing.

Why would models and entities that had disappeared before suddenly appear, and models and entities that were there before suddenly disappear?

I'm thinking that there's nothing wrong with my models and entities themselves, but rather there may be an issue either with numbering system of the models and entities in my level (removing and "undoing" (re-adding) may change their "block number" somehow?), and/or 3DGS can't handle the number of models and entities I have in my level.

Can anyone else confirm or deny these theories? Is there some way I can force 3DGS/WED to re-number all the blocks and entities in my level?
Posted By: Galen

Re: Level won't display properly with any script.. - 01/02/07 23:05

Okay, after more tinkering and searching the forums here, I discovered that by lowering the max_entities a bit, I could improve the speed, so I lowered it to 2000 from 5000, and that seemed to help camera speed a lot.

When I build the level, it says it is placing 1234 objects. I am still getting an error of "Can't Load", and as per my previous replies, various entities/models just won't show up, even the all the ones I checked have noting wrong with them (ie, entities within entities). Does anyone know why WED would choose to not load some entities and models, yet choose to load others?

Thanks...

Also, is there a way to have WED report what object is causing the w1508 "Can't Load" error when I run it?
Posted By: Thomas_Nitschke

Re: Level won't display properly with any script.. - 01/03/07 16:52

This is really getting interesting... in unfortunately rather negative a way. Since I have no ideas left as of now, you should probably consider posting a quick reference to this thread on the "Bug Hunt" forum.



PS. I thought I should mention this: You seem to be one of the rather oldschool Acknex users around here I suppose so because you refer to WED loading objects (instead of Acknex - WED has nothing to do with the errors you're getting) and to "Preview Mode". No offense but this is a little outdated
"Preview Mode" is an ancient term for the mode A4 still had. However A6 doesn't really have anything of the like. What you're refering to is nowadays simply called the WED 3D View. I'm telling you because when calling it "WED 3D View", it becomes more obvious that this view has plain nothing to do with the Acknex Engine. Since you stated you were a little bit surprised that your level showed up in "Preview Mode" but didn't once you ran it, I have a feeling you might have confused that.
Posted By: Galen

Re: Level won't display properly with any script.. - 01/03/07 23:26

Actually, I've only been using 3DGS for a couple of years now--you're giving me more credit than I deserve. heh

The "Preview Mode" I refer to is actually "Preview Level", available under the "File" menu... (as opposed to the 3D view window one sees while working in the level)

My level looks fine in "Preview", but for some reason it doesn't in "Run" mode. I can see the materials and actions working in "Run" (which don't show in "Preview"), but not all of the entities are loading. Like I said before, if I remove them all from the level, then add them back in, different entities will show and different entities will not show as opposed to running the level before I remove and re-add them. It's really weird. I think you may be right that this is a bug. I've gone over all my scripts, and I don't see anything (they're really simple scripts) that should be having any effect like this. I don't know why other people haven't noticed this, unless their levels just don't have enough objects in them to trigger this bug, but what do I know? At this point I think I'd pay money to have JCL or Doug look at my project file and tell me what's wrong with it... (assuming they'd do it)
Posted By: Galen

Re: Level won't display properly with any script.. - 01/04/07 18:55

Well, if nobody else has any comment on this issue (of some entities not appearing when a level is run that contains many entities, and which entities appearing and not appearing seeming to be entirely subjective), then maybe I'll go ahead and submit this as a bug with screenshots, etc, later this evening?
© 2024 lite-C Forums