Large model 2mb - Freezes Blitz3d

Blitz3D Forums/Blitz3D Beginners Area/Large model 2mb - Freezes Blitz3d

Imperium(Posted 2013) [#1]
I'm working on a rather large detailed map. The faces are exactly 35,001. This is well below what my computer can handle obviously since Halflife2 character models are around 5000 triangles a piece. I removed the lighting and everything else to rule out what is causing blitz3d to just show a black screen. I can alt/tab out of it but the task manager(process explorer) won't let me click to end the program. The only way out is to restart my machine via the reset button.

The model format I am using temporary is 3ds. Are there any known issues with this format I should know about? I will try and break up the map into 4 different sections and or convert them into BSP data. Honestly though a 2mb model shouldn't lock up my program.


GfK(Posted 2013) [#2]
I believe Blitz3D has a vertex limit (rather than a face limit). I *think* it's 65536 per surface, but don't quote me.


Imperium(Posted 2013) [#3]
Must have been the problem because after I split the model into 2 separate half's everything worked again. Thanks for the help because I was ready to panic. When my map is completed I expect it to be over 700,00 faces.

Currently there are 63534 vertices in my map. A vertex is the common endpoint of two or more rays or line segments. A vertices is a corner on a polygon or an angle. Any idea why this limitation exists or is it simply a DX7 thing? It's not a big deal I'm only curious. Cutting up the models doesn't bother me.


Yasha(Posted 2013) [#4]
Indeed, there is a vertex limit. It's usually 65536, but I think (could be wrong) that this may actually be machine-dependent and a matter of convention rather than specified anywhere; I tend to try to assume 32768 for compatibility's sake (probably a fairly stable convention nowadays). Results will certainly vary from device to device if you go over the limit though (my machine for instance usually runs a scene normally but with some polygons dropped). At any rate the reason for it is that there's a maximum size of buffer that can efficiently be passed to a graphics card, and it tends to go unchecked.

On the subject of the 3DS format: yes, there are issues - it is a poor choice of format for representing architecture or anything with sharp edges as it does not store vertex normal data, instead clumping faces together into "smoothing groups". The lighting on hard-edged objects will usually be completely messed up and either blurry or with weird light and dark streaks, as a result of this. You can solve the problem by rebuilding the normal data within B3D, but you can also avoid it entirely by using B3D or (as you guessed) BSP formats. Note also that BSP, much like MD2 and terrain, is not considered a "mesh" (although it is an entity), and goes through its own separate render system. Since BSP was designed for large maps from the outset, it might (do not take my word for it) not suffer from the same limitation.


Kryzon(Posted 2013) [#5]
Now that you mention it, Yasha, BSP is something that in all these years I've never tried with B3D.
The help file only has the code, it doesn't come with the actual level file to run the demo.

- I found a BSP file around the web, you can download it here: http://www.mediafire.com/?n5ih0ootxa346ry

- Unpack everything in some folder.

- Run the code to view it. It's based on the original B3D help file (just fix the file path to load the level):


If you navigate through this level in wireframe mode, you'll see it doesn't render parts of the level you can't see, based on the portals.
If it were a single standard mesh, it wouldn't do that optimization... it might be an interesting path for NostalgicAlgorithms to use for his levels.


MCP(Posted 2013) [#6]
There's an old thread on the subject here... Blitz3D mesh limits


Imperium(Posted 2013) [#7]
The reason I used .3ds is because it is the only format that Meshlab allows me to convert models into that blitz can use. This is only for testing until I download a proper convertor. I haven't witnessed any of those strange lighting issues yet Yasha, but maybe that's because I don't export the normals when I save the model as .Obj before converting it into 3ds?

I suspected BSP would be my best option. As Kryzon stated it won't render what you can't see. Since my end result for my map is expected to be at or above 70,000 faces it would benefit greatly from this added optimization.

@Kryzon
That file won't unzip for me? I'll try downloaded it again when I get home tomorrow.


RemiD(Posted 2013) [#8]
If you want to increase your chances of compatibility with most machines, i suggest to use meshes which have surfaces with less than 32000 vertices/tris.

I have tested this code on 3 different machines :


Lenovo E325
MAV at Renderworld()
VerticesCount = 54618
TrianglesCount = 18206

EEE pc 900
i have stopped when the VerticesCount was superior to 33000, the machine almost burned...

EMachines EL1352
MAV at Renderworld()
VerticesCount = 54618
TrianglesCount = 18206

But i remember having had MAV at Renderworld() when a surface had more than around 32000 triangles.
Try DSS, you will see what i mean if you add too many closed meshes to cast shadows.


Kryzon(Posted 2013) [#9]
In the end I don't know if using a BSP is much improvement than rolling your own portal system.
Blitz3D's BSP system is very rudimentary - there's no way to setup doors, for instance. So if you have a huge corridor that leads to several rooms, if you look at it then all these rooms will be rendered, regardless if you have any door meshes that you know completely occlude the rest of the corridor.

If you have your own system, however, you can easily make it so that doors hide the other side.


jfk EO-11110(Posted 2013) [#10]
And: you can loadmesh huge meshes, just don't rendetworld them. So, you can split big surfaces in peaces, recc a max of 30000 both, verts and tris. But, if you are now going to Addmesh them all to one Mesh, Directx will automaticly unify those with identical brush properties! Resulting in the old, high tris/verts count again. All you can do is create slightly diffrent brushes and use them on these split up parts. Like Brush shininess that ranges +- 1,2,3 or some other subtile details.


Imperium(Posted 2013) [#11]
*deleted*


Imperium(Posted 2013) [#12]
Here is what I don't understand about BSP maps. How do you texture them? Do I just apply the material/texture within my CAD program? As long as the bsp map and textures are in the correct directory it will just magically work when loaded with Blitz3d? I'm guessing multiple textures per mesh it then out of the question?

Lastly how can I convert meshes into BSP without using Quake editors? I prefer to build my maps with a real CAD program.


Kryzon(Posted 2013) [#13]
If I were making a professional game with Blitz3D, I'd forget about BSPs and work with regular model formats and a few smart visibility techniques.

But to answer your question: http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Bsp+making#Step_1:_Which_3D_program_use_first_to_make_a_scene_for_BSP_

EDIT: Venus Hostage is the game with best production values made in Blitz3D that I know of, and they didn't use BSPs.


RemiD(Posted 2013) [#14]
NostalgicAlgorithms>>I have found a simple way to do "occlusion culling" on a game similar to yours, if you want i can write some explanations.

It can be useful if you can seperate each room into one mesh, each passage/door being the "connection" from one room to another.


Imperium(Posted 2013) [#15]
All that extra work and software for using BSP? No thanks...

If you have an example RemiD you could share that would be most righteous.


RemiD(Posted 2013) [#16]
Ok. I will try to explain :

To begin, you need to have one mesh for each room
For example, i store all my rooms in an array

Dim RoomMesh(RoomsMaxCount)

Then, you need to know which rooms are connected to others rooms.

For my game this is not a problem because i create all rooms/corridors procedurally so this is known automatically.

For each room i store the connections from this room to others rooms.

For example :

Dim RoomConnectionsCount%(RoomsMaxCount) ;the number of connections from this room to others rooms
Dim RoomConnectedToOtherRoomId%(RoomsMaxCount,ConnectionsMaxCount) ;for each connection, the Id% of the other room connected to this room

All that i have previously explained must be precalculated.

Then, in the mainloop :

I retrieve the RoomId% in which the player is (and thus can see).

There are several approaches to do this :
Assign a RoomId% to the player at the start of the game because i know where i have positionned him, and then use triggers before and after a passage to know if he is going from one room to another.
or
If the rooms have a square/rectangle shape, i use a minX minZ to maxX maxZ calculation to determine in which room the player is.
or
If the rooms have an irregular shape, what i have tried is to first do a distance2D calculation to find in which rooms the player may be and then use linepick or throw a moving collider sphere toward a low tris collider of the ground to determine in which room the player is.

Once i know in which room the player is, this is easy :
I hide all rooms
I show the room where player is (the active room)
I show the rooms which are connected to the active room
I show the rooms which are connected to the rooms which are connected to the active room

This works well and it does not take much time to do these calculations.

The other thing i do is that all the meshes which are static (columns, sculptures, containers, furnitures, rocks, plants) are set as childs of a room and thus are shown or hidden automatically if the room is shown or hidden.

I hope this is clear enough.


virtlands(Posted 2013) [#17]
N.A. said,
"I can alt/tab out of it but the task manager(process explorer) won't let me click to end the program.
The only way out is to restart my machine via the reset button. "

Hi, I have this idea of how to exit from a stalled Blitz3D session, without restarting your PC.

download PSTools Suite
http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx
http://www.softpedia.com/get/System/System-Miscellaneous/PsTools.shtml

Run a command prompt (as an Administrator), and type pskill blitzcc.exe. That should fix it.

You can also try any of the following, to accomplish that and more:

Process Lasso : http://bitsum.com/processlasso/
Process Explorer: http://www.filehippo.com/download_process_explorer/
Process Monitor: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
Process Hacker: http://sourceforge.net/projects/processhacker/?source=directory

Ultimate Process Killer: http://sourceforge.net/projects/ultmprokill/
What's Running: http://www.whatsrunning.net/download.aspx
Process Stopper: http://download.cnet.com/Process-Stopper-Spoolsv/3000-2086_4-10609180.html
Process KO: http://www.softpedia.com/get/System/OS-Enhancements/ProcessKO.shtml

--- Here's a neat screenshot I took of Process Hacker running on my machine.
-- Notice that Firefox consumes about 720MB of memory.
-- Further down, blitzcc.exe uses about 34MB of mem.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Also, thanks for the BSP file, I'm not familiar with that 3D stuff at all, eventually I shall get into it.