test build a structure with parts (in code)

Community Forums/Showcase/test build a structure with parts (in code)

RemiD(Posted 2014) [#1]
This is my try to build a structure (a room) with parts : paving stones, bricks, beams, planks. All done in code.
An omnilight with DX7 vertex lighting, some flickering
An emitter, some particles
and :
(see post#5)
ZQSD to turn/move
You can press the space key to change the light position and color

I like to look at the shades of lighting, it relaxes me. :)


Yue(Posted 2014) [#2]
very nice!!



Ploppy(Posted 2014) [#3]
I agree - great lighting..


RemiD(Posted 2014) [#4]
The ceiling needs some improvements imo, but i am not sure how to build it, i have to study how they built old houses.

What is good with building structures with parts in code is that you can build one or thousands in a few seconds :)

If i had to modelize the floor with each paving stone, the walls with each brick, the ceiling with each beam/plank, it would have taken many hours.


RemiD(Posted 2014) [#5]
I have improved the ceiling, it looks better now.

rd-stuff.fr/build-a-structure-with-parts-201407291040.7z

It is amazing how you can create nice shades of lighting by simply modifying slightly the orientation of the parts which compose a structure. (in this case the paving stones, the bricks, the beams, the planks.)

The structure is not textured and not colored but we can still see the different shapes thanks to the vertex lighting.


Rick Nasher(Posted 2014) [#6]
Looks great. But: Isn't this incredibly high poly?
If not, can this be used to make a destructible structure? :-)
Is collision detection still possible?


Krischan(Posted 2014) [#7]
Very nice. How does it look textured? You could even use some DOT3 lighting like I did in my old ORCS thread, see the dotlight.bmx source there.


RemiD(Posted 2014) [#8]

Isn't this incredibly high poly?


No, without particles there are only around 27000 triangles in 6 different meshes with 1 surface in each mesh.
The render time is only 4ms on my machine (a low end laptop) without particles and if you want 30fps you have around 33ms to do all your things.
I have to code a system to have one mesh with one surface to contain all particles because for now the particles are separate meshes.


can this be used to make a destructible structure?


Yes you could, if i had to do that i would keep a list of each part (paving stone, brick, beam, plank) for each floor, wall, ceiling, and rebuild the mesh when necessary but i don't know if this is fast enough to do that.


Is collision detection still possible?


Yes i could build a low tris version of the floor, the walls, the ceiling, the obstacles and it would be fast and work well.


How does it look textured?


No idea, i plan to work with meshes without textures and color the different materials with vertex color.
But i have also started to code a routine which automatically unweld, texelsfill, each triangle, then build a texture, then set the uvcoords of each vertex of each triangle, and this will add more details to each part but it will not be done by hand, this will only add details (=lighter or darker texels) to each part and to add one color for each material. More of a programmer style than a graphist style ahahah.

Your ORCS demo looks good. :)
Personally, i don't like to build a map in a modeling program because i find it too time consuming and not random enough and also because when i build a map without randomness, i usually don't want to explore it afterwards, hence why i do what i do.


AdamStrange(Posted 2014) [#9]
No, without particles there are only around 27000 triangles

Yes, this is incredibly high poly count. in 3d a poly is another (incorrect) way to say triangle!

So 27000 triangles is über high poly count

as a quick guide - a monster/character should aim for less that 1000 tri/poly. <500 = great, <250 = brilliant. <10 you get a 3d gold star :)


Yasha(Posted 2014) [#10]
as a quick guide - a monster/character should aim for less that 1000 tri/poly. <500 = great, <250 = brilliant. <10 you get a 3d gold star :)


Sure, ten years ago.

These days 2K is considered low-poly for most games. Under 500 is ultra-low Quake-style graphics, under 250 is PlayStation 1. For a AAA game 5-10K is perfectly normal for a character.

Of course modern game engines are much more efficient at handling large numbers of polygons than Blitz3D.


RemiD(Posted 2014) [#11]
No this is not really high tris, Morrowind in 2002 already used more than 100 000 tris for the terrains/buildings/furnitures/containers/items/rocks/trees/plants.

The number of tris is not what increases render time, the number of surfaces is.

Also if it runs well on most machines, this is what is important.


as a quick guide - a monster/character should aim for less that 1000 tri/poly


From my tests around 2000tris for a rigged skinned animated character is ok. Do some tests you will see. It will run fast enough on most machines.

From my tests, a limited amount of surfaces is the best way to decrease render time (after having hidden the meshes which are not visible...). The number of triangles does not matter that much.


RemiD(Posted 2014) [#12]
I have just realised that i would only need to unweld/texelsfill/uvmap/texture one paving stone, one brick, one beam, one plank, before building the structure and have only 4 small textures for the whole structure. :)


Rick Nasher(Posted 2014) [#13]
Can't wait to see what it looks like.(screenshot? beg-beg) :-)

If this indeed could be used as a destructible model then you might have struck gold cos would look great in a game to have something like that. Something completely new for Blitz.

I managed to create destructible(sort of) terrain, in the sense that you can throw grenades that make craters leveling the terrain, but other structures that would be demolishable would really add to that..


RemiD(Posted 2014) [#14]

If this indeed could be used as a destructible model then you might have struck gold cos would look great in a game to have something like that.


I see a way to do it :
Keep 2 structures for each structure :
One structure made of individual parts (individual meshes) which are invisible (entityalpha(mesh,0)) and collidable
One structure made of one mesh with one surface (or a few surfaces) which is visible and will be used for the render
When a weapon/tool/projectile collides with some parts, update the individual parts, then rebuild the surfaces.

If you keep the floor, each wall, the ceiling, as separate meshes, each mesh with one surface, it will be even faster to rebuild.
A slow down may happen when a weapon/tool/projectile collides with several floors/walls/ceilings, because there will be more surfaces to rebuild.

On my computer, it takes around 99ms to rebuild the whole 10x3x10 room (1 floor, 4 walls, 1 ceiling) with parts so it will probably fast enough if you can destroy and then rebuild only 3 meshes (floor or wall or ceiling)
Another approach would be to display the structure of the current area (where the player is) with separate parts and the structures of the others areas as one mesh with one surface. And rebuild the surfaces of a structure only when player leaves the current area.

It depends on which kind of computer hardware you want to distribute your game...


Blitzplotter(Posted 2014) [#15]
Impressive looking rooms, great looking shading.


RemiD(Posted May) [#16]
slight update with colored materials : http://rd-stuff.fr/build-floorswallsceilings-with-parts-201407292048EXE.7z

(press the space key to change the position and the color of the light)
edit : added first person view controls


Flanker(Posted May) [#17]
Very nice demo, this looks quite awesome with antialiasing enabled :



Naughty Alien(Posted May) [#18]
..even very simple, for some reason, i like it very much..displaced surfaces giving really nice touch and depth to whole thing...niceeee


RemiD(Posted May) [#19]
I was planning to make a random dungeon generator using this graphics style, i was inspired by the rooms of the game "legend of grimrock" but since there is no bump mapping with blitz3d, i chose to build the room with parts (meshes) and slightly offset and oriente each part differently...
The result is one mesh one surface (or rather the minimum number of surfaces possible) colored by vertices colors.