Post news Report RSS Rain/Sprinklers - DarkPlaces Materials Test Map By GremlinForester

Rain and sprinkers effects in a materials test map showcasing some material effects that are possible in the DarkPlaces engine. Download the map (.pk3), place the .pk3 in quake id1 folder (NOT the maps folder) and type "map test_mat2_dp" to try it out. In Zircon Engine, to get the full effect Options->Effects and set it to level 4 or 5.

Posted by on

May 1: Hardest Part Done (Download: Zircon Beta #49 - Win64)

The "hardest part" lived up to its name, it wasn't fun -- and it is now completed. It was hard enough that I still don't feel any sense of victory from finishing it yet -- that will eventually sink in later.

Should be all downhill from this point forward, now with the toolset necessary to do some interesting user-interface work.

April 30: The Grind

Working on the hardest part. The latest in a series of other hard parts. Hard, harder, hardest. The march of coding.

Once this part is completed, it will be the refinement stage where I take the new capabilities and make something nice with it.

April 27: Dot Dot Dot ..

Work on the user-interface continues ... visually nothing new. Everything lately has been wiring for input/text parsing/mouse actions .. these activities are not very visual so no screenshots at the moment.

April 24: Gradient System

Prying into the inner workings of the 2D drawing system in DarkPlaces, there was something I needed to test and I wasn't certain what the result would be.

gradientThe 2D Polygon Drawing System, unlocked and available to the engine for drawing now in Zircon. DarkPlaces Beta retains the DarkPlaces Classic capability of drawing gradients.

DarkPlaces Beta -- the base of Zircon Beta -- has a rewritten 2D renderer that affects CSQC. It does not render exactly like DarkPlaces Classic ("DarkPlaces 2014").

The DarkPlaces Classic system of 2D drawing supported drawing gradients. Does DarkPlaces Beta?

Fortunately the answer is yes. I was not sure until the test -- the new 2D drawing system is more "Q3 shader based" and that is quite nice (shaders in 2D user interface including animations) -- however, the Q3 shader system does not use gradients at all.

Why Do Gradients Matter?

Without gradients, 2D drawing is solid color. Gradients can make buttons and other user interface elements look less "bland". If you played the Quake3_Quake1 Tech Demo and talked to one of the NPCs, you might recall the interaction screen had -- rounded rectangular buttons.

Those buttons are not images. I wrote CSQC to do a rounded polygon draw of each of the 4 corners of the buttons and the CSQC code specifies the corner drawing method (radius/etc).

April 23: Clipping / Scissor Area

User interface works continues. When drawing a text area, it is desirable to slightly overdraw text but clip the draw using a scissor region.

cliparea

In DarkPlaces Beta (and therefore Zircon Beta), setting a scissor area will trigger an immediate draw of the current batch of 2D interface draws queued up.

Note that setting scissor regions are available in DarkPlaces via CSQC.

void(float x, float y, float width, float height) drawsetcliparea 
Specifies a 2d clipping region (aka: scissor test). 2d draw calls will all be clipped to this 2d box

April 22: Overhang (Download: Zircon Beta #49 - Win64)

Fonts have "overhang", sometimes called ascend/descend, it is space for the letter "j" and friends to render below the text "line".

overhang

This information is helpful for drawing purposes, the "vertical size" of a font and can contain a lot of "dead empty space" for overhang, making vertically centering text look quite off-center. DarkPlaces loads TrueType fonts, but looking around it was not loading that information. The freetype library documentation was not particularly helpful, but I did manage to get Zircon to load this ascend/descend information to make these calculations.

https://media.moddb.com/cache/images/downloads/1/270/269066/thumb_620x2000/smokey_lit_sprite.gif

Classic DarkPlaces supports lit sprites. You put an exclamation in the name, and DarkPlaces will interpret the sprite as lit by map lighting and such instead of normal sprite fullbright rendering.

It does not correctly render in Zircon Beta or DarkPlaces Beta at the present time. (It does render correctly in Zircon Alpha, which is based off Classic DarkPlaces).

April 21: Working Away

As I continue to work on the next version which begins to use some graphical interface enhancements (for game data inspection at first), there are certain things that DarkPlaces has in the source code and the CSQC that make me happy:

  • Dynamic array support
  • Tokenization of strings in a variety of different methods (including exposing them to QuakeC).
  • String list manipulation including sorting.
  • Several CSQC text manipulation functions because the strings work with DarkPlaces color codes etc.

where is pacman machine

None of what I am doing with the user interface uses QuakeC, it is all engine code. However, the CSQC functions allow quick examination of how to minimally get a certain result.

For instance, DarkPlaces supports font color codes and unicode. I don't need to try to determine how to get the length of these strings, CSQC has functions to do those, which is a quick reference. The length of the string is different than the rendering width of a string (on-screen size), likewise the CSQC functions are a reference.

The source code for DarkPlaces has its own wide toolset, and used steadily over the years by heavy use in Xonotic.

April 19: DarkPlaces Game Startup Fix

In next version of Zircon: Thanks to some experimentation and insight, jakub1 helped zero in on rare issue that affects DarkPlaces where some entities are solid to projectiles when they should not be.

web block2Pictured: I have Visual Studio running Zircon in debug mode, a web browser with 20 tabs opened and video capture software running so that I could record this bug before enabling the fix.

The next Zircon has this fixed. (I also documented shared the fix at DarkPlaces github).

I would classify this issue as very non-obvious and file it in the "difficult to understand/identify category".

When jakub1 said he experienced the issue, while I started it up and everything worked fine -- I knew there was an issue, but it didn't happen for me so wasn't sure what to do exactly.

Jakub1 did some experimentation and managed to identify deleting a certain file (quake.rc) actually fixed the issue, I compared versus a typical quake.rc and looked through the engine code and located how this difference could adversely affect DarkPlaces startup.

April 19: Developer Info

In the last month or so, there were new Zircon console commands that exposed shader information and other information. Those console tools were laying the foundation for "actual plan" (console commands are nice, but a graphical user interface is living the high life).

devinfoPictured: Some very early ground-breaking activities.

Now that the DarkPlaces TrueType support more malleable for general usage in the engine code and the ability to embed data (icons, etc.), the real terraforming phase can occur.

Quite a bit of work ahead .. this where the real fun starts!

April 18: Font Battle Concluded

Adding loading pak/pk3 from memory proved to be too much work. DarkPlaces is super-hardwired for using file handles to read data. However, there is a"selfpack" feature already written. I looked at the code and wasn't able to figure out how it worked, then I took a guess and did "copy /B zircon_beta_gcc.exe + bundle.zip zircon_beta_gcc2.exe" (this concatenates a .zip file to the end of the zircon exe -- a .zip file and a .pk3 file are the same thing) and it worked, activating the self pack feature.

The desired result was achieved, but in a different way.

A Waterfall Investigation.

The work invested in TrueType fonts from memory proved to be what was needed, I am loading the fonts outside the DarkPlaces traditional font system and I don't want the data somehow cleared by a user or some DarkPlaces mod that does something I hadn't considered.

April 17: TrueType Fonts

I have been rewiring Zircon to use TrueType fonts from memory (done). Realized what I actually want is to load pak files from memory. The pak/pk3 system in DarkPlaces doesn't support that, and I didn't really want to code that.

After carefully considering the various options, coding "loading pak from memory" has enough advantages that it is worth it. "Didn't really want to code that" ---> Coding that. Such is engine coding ...

This one has a fantastic payoff though.

Investigating Spiderwebs and Waterfalls

April 15: Fixing Cvar System

The cvar system in Zircon Beta is not perfect and started with the DarkPlaces Beta version -- which at time of the origin of Zircon Beta (October) would crash on gamedir change, I had change some things to fix it and under some circumstances it can be untrustworthy. And it is overly complex for the simple thing it is doing.

warp

No visible reward for fixing it, but gamedir switching is important and I want to fully trust it.

DarkPlaces allows cvar creation, cvar destruction and can use the fteqcc "autocvar_" feature -- amongst many other things. I'm going to see if I can get the code to collapse into simplicity, while having it do exactly the same thing.

Engine coding sometimes involves working on things with no visible results. Comes with the territory.

April 14: Console Selection In #49

I wanted to copy some text off the console and less than the what the Zircon "copy" console command does -- which is the whole console. But that wasn't a feature.

It wasn't the first time I wished Zircon had that as a feature. It was, however, the last time.

copier

Because of the way DarkPlaces does the console -- the console in DarkPlaces is very nice but so very complex, this was crazy hard to do. Sometimes it wraps lines, many lines simply don't display because they are tagged "developer 1". There were other obstacles.

The joy of copying text from the console made this worthwhile! It selects entire rows, dodging TrueType font support variable width considerations and such.

April 13: Console Selection

Mouse highlighting/selecting/copying console text is coming in next version. DarkPlaces has a quite a few features in the console log that are great, but make this a bit complicated to code. For example, one really great feature in DarkPlaces is "developer 1" suddenly reveals previous messages, it stores a "mask level" for each line of console print.

April 12: Texture Filtering Cvar

See notes in the description, but most noticeable change is Options->Change Video Mode has texture filtering setting and it saves to config. ALT-ENTER timer limiter is removed ..

wall

Options->Change Video Mode -> click Texture Filtering -> Set Nearest -> Then Go Stare at a wall


ALT-ENTER timer is removed .. in the past during map change Zircon could crash under circumstances that were not entirely clear if done during map change -- this seems to no longer happen (right? right ... ? /Is Keeping eye on that).

There are larger changes that will require a demonstration mod to see.

Rain and Sprinklers Materials Map (Download: Zircon Beta #47 Win/Linux)

GremlinForester made an incredible materials test map. He has been sharing insight on ideas on how to add some flexible options to the DarkPlaces shader system (in the coming days, I intend to be coding those). GremlinForester's notes/credits are in the download full description.

Download the map! (download: test_mat2_dp)

Put pk3 in quake\id1 folder. Type "map test_mat2_dp". Enjoy!

mattest2 rain1

In Zircon, goto Options->Effects and use Level 4 or higher for full effect.
mattest2 move


mattest2 sprinkler2


Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: