What Blitzmax+MiniB3d still can do

Community Forums/Graphic Chat/What Blitzmax+MiniB3d still can do

Krischan(Posted 2014) [#1]
I just want to share a tiny milestone of my Oldschool RPG Engine ported to Blitzmax, ready to run and including full source+media. A simple 2D map made in Excel (yes, Excel is a good Mapeditor!), converted to Radiant Map Format, improved for lighting tests within Radiant and finally rendered with Q3MAP2 to a BSP. This BSP is being parsed to separate meshes in MiniB3D using Normalmaps and DOT Lights for better lighting.

But see yourself what vanilla miniB3D is capable of without shaders (click for full size):



Download Demo+Source (8.9MB)

Walk with arrow keys, D show/hide Dotlights, Z enable/disables Z-Order sorting, RMB = Torchlight on/off


Brucey(Posted 2014) [#2]
Pretty :-)


Rick Nasher(Posted 2014) [#3]
Very well detailed. Luv the lighting. Who are the people in the paintings, and.. did you do those yourself too or are they existing works? ;-)Obviously you are doing great in BMax using MiniB3D. Do you consider it the better choice over Blitz3D?


Guy Fawkes(Posted 2014) [#4]
No. It's laggy even for MY graphics card. Which is an Nvidia GeForce GTX 750 Ti that can run the Heaven benchmark on 30+ FPS. I'm only getting between 15 - 20 FPS with this demo, I'm sorry to say.


stayne(Posted 2014) [#5]
There's more to processing graphics than just your graphics card. RAM, processor speed, etc. Post the rest of your specs son.


xlsior(Posted 2014) [#6]
Pretty, but only took ~10 seconds for the motion sickness to kick in. :-?


MadJack(Posted 2014) [#7]
10 seconds for the motion sickness to kick in

<cough>pussy<cough>


Krischan(Posted 2014) [#8]
Thank you guys.

But 15-20 FPS? Here on my GTX 780M / i7 4770K (3.5GHz) I have constant 60FPS and when you press "V" which enables/disables VSYNC, umm lets see yourself, over 1100 FPS - are you sure you pressed the "Turbo" button on your 80386 rig? ;-) Even in the maximum possible fullscreen resolution mode here at 2560x1440 i have about 400FPS.



The only code part which actually stresses the CPU is the ZOrder sorting every frame, but we're talking about only a few hundred vertices to sort here - see yourself in the main loop, it is nearly empty. Disable it with "Z" and see if this increases the FPS. Beside that, the FPS calculation in the upper left is a long-time average FPS calculation, not per second like in Fraps. So if you run the demo for a longer time you'll get more precise values.

Rick, The people on the paintings are taken from [a http://commons.wikimedia.org/wiki/Category:1669_portrait_paintings]Wikimedia Commons in the time from 1660-1760[/a]. Yes, Blitzmax+MiniB3D is better and in some situations faster than vanilla B3D. And I love the more Object-oriented programming there and hate the casting in Superstrict Mode but this forces me to create better code from the beginning.


degac(Posted 2014) [#9]
Nice example.
I noticed that there's no 'culling' of the rooms (if you turn on wireframe view you can see all the rooms in the levels): maybe with some sort of culling enabled things could be a little bit speeder.


GW(Posted 2014) [#10]
Very cool. Thanks!


Krischan(Posted 2014) [#11]
No there is no culling yet. I'm using only a few textures and ALL walls for example are single surface, look at the FPS and I'm using no shaders so the graphics card is bored to death. Perhaps if it'll become more detailed. Culling of detailed props I'll place later makes sense.


Hotshot2005(Posted 2014) [#12]
Are you going do Bump mapping on the wall or it is already there?

You have done very well :) Nice One!


Krischan(Posted 2014) [#13]
It uses DOT3 bump mapping with normals maps. Each colormap texture in this map has a normalmap, too. It would look much better using shaders but vanilla miniB3D has no shader support. It just uses the vertex colors and a greyscale version of the lightmap plus additional DOT3 vertex lighting to achieve this effect.

Layer 0: Vertex Color
Layer 1: Greyscale Lightmap, Blendmode 5
Layer 2: Normalmap, Blendmode 4
Layer 3: Colormap, Blendmode 2 (or 5 is possible, too)
Layer 4: Original Lightmap, Blendmode 3

The Vertex Color is identical with the MINLIGHT Variable which is here 120 (116 would be darker, 128 brighter). It is the Torch Lightcolor value, too. The Dotlights colorize the grey vertex colors of the level - from their position some linepicks are casted to the level geometry, check if there are wall collisions and color the vertices like in a normal map. The more vertices you have there, the better will be the bump mapping effect but it takes longer in the initial calculation - I think this can be precalculated and stored to optimize it.

When you walk around, only the vertices will be illuminated by the torch light and gives some torch light effect on the normalmaps (only brights them up but does not calculate a per-pixel lighting on the normalmaps). It is not very complex but I had to play around with the values to get this lighting effect. It is not 100% mathematically correct but looks good so far and much better than only a lightmap.

Here are three screenshot of the untextured level, 1st only vertex colors, 2nd vertex+greyscale lightmap and third vertex+lightmap+normalmap. You can clearly see the bumpmap effect (you can try it yourself if you uncomment the BrushTexture commands in the q3bsp.bmx):






Who was John Galt?(Posted 2014) [#14]
Very cool. Front page material.


Rick Nasher(Posted 2014) [#15]
Very interesting techniques..


RemiD(Posted 2014) [#16]
Nice looking demo :)
The controls are similar to Legend of Grimrock isn't it ?


Steve Elliott(Posted 2014) [#17]

No. It's laggy even for MY graphics card. Which is an Nvidia GeForce GTX 750 Ti



I have the same graphics card so something is very wrong with your system.

It runs very fast here, but there seems to be a bug in the FPS calculations. For example if I run the program (v-sync off) and simply watch the screen, the FPS climbs and climbs. Pressing v again settles it. Also, running your demo sometimes it's near 400FPS, other times more like 300FPS. The first time I ran it it was about 1000 FPS!! Maybe something to do with where I was when I turned off v-sync.

Looks nice though.


Matty(Posted 2014) [#18]
Ran ok. Not hugely impressed. Just looks light a light mapped scene in b3d with a few flickering lights. Controls were unusual - wasn't expecting cursor keys and to move in those discrete steps.

It wasn't terrible or anything just nothing spectacular...not compared to your space stuff anyway.

Oh...how do you go up the stairs?


Krischan(Posted 2014) [#19]
Matty, what did you expect? Legend of Grimrock in vanilla miniB3D? :-) At this point, I don't know how to improve the lighting further. I'm proud that my BSP loader works so that I can use a reliant Level Editor like Radiant for the mapping. Shaders would be fine but miniB3D does not support them. Perhaps realtime shadows? But how to implement them? Do you have any suggestions what can be made better using miniB3D only?

I made a small animation to show the difference between a simple "Light mapped scene" only and the "Dotlightmapped scene" with Normal Maps and Dotlights you see in this demo (click for original resolution):



GIF Animation comparison

The stairs are without a function yet, its just a graphics demo of an oldschool RPG remake attempt. I've kept it simple as an example to show how to do it. Sure the stairs will lead to another level later. And I love to use cursor keys like in my space demos. And if it'll become a game one day, there will be a WASD implementation/option, too. But not yet.

And Matty, the FPS counter is only a loose approximate average of all FPS counted ever since the program starts and simply divides them by the frames. Ok, the FPS count could reset when switching Vsync mode to give a more accurate output. If you want real frames per second, output the variable "fps" instead of "averagefps" in the text command.


vinnicius(Posted 2014) [#20]
Cool


Steve Elliott(Posted 2014) [#21]

Matty, what did you expect? Legend of Grimrock in vanilla miniB3D? :-) ...I'm proud that my BSP loader works so that I can use a reliant Level Editor like Radiant for the mapping.



Don't be discouraged Krischan, you've made good progress...The lighting is more realistic by turning the torch off.

Hmm, but I think that flashing animation of light map normal map is going to give people a headache or seizure...Just post the pictures side by side for comparison.


JoshK(Posted 2014) [#22]
I'm the biggest graphics fan there is, but it's really all about gameplay. Often times twiddling around with obscure graphical settings becomes a way to avoid buckling down and doing the real work.

There was a series of playable FPS game demos, some in some big mansions, on here a few years back made with Blitz3D. That was a good example of getting real work done.


John G(Posted 2014) [#23]
Looks terrific.


Krischan(Posted 2014) [#24]
Steve, no more headaches - compare in hires now.

And yes Josh, its all about gameplay. But you need something for the player's eyes and ears called "immersion", too. You don't need ultra realistic graphics but it should still have a minimum but sufficient level of visual scenery. Example: here you are in an old dark castle of a vampire so it should be midnight with a thunderstorm, lightnings, flickering torches, knight armors, carpets and strange paintings and all that stuff you would expect there. Here, the lightmap looked good so far but it was not "dark" enough so I experimented with the Dotlights. I think it has more immersion now than before and wasn't that hard to code as the normalmaps and some initial vertex calculations "do" the job.

The alternative is to return to text adventures like Zork ;-) They are a lot easier to code and we don't need to upload screenshots anymore...


Rick Nasher(Posted 2014) [#25]
Love it so far.


RemiD(Posted 2015) [#26]
Interesting render, but the normalmap effect is not as good as a bumpmap effect to give relief to a surface (imo).

Why do the surfaces seem to be less lighted (more dark) with the normal map than with a lightmap ? (with a bumpmap effect, some parts of the surface will be less lighted (where the holes are) and some parts of the surface will be more lighted (where the bumps are), but the light should spread the same way on all surfaces.