Hello, everyone.
---- some description where am i coming for ----
I have some Delphi / desktop apps program experience (actually, was the last JediVCL Delphi 5 maintainer for a while).
Now i have to quickly, and in a spare time, sketch a simple simulation app. Main problem to me was Delphi audio is Win16-era API. And i would have eventually to make multi-channel almost realtime simulation (samples with some processing, probably, but that is to be researched yet). Also some very simplistic, but fast 2D graphics would be needed (previously did with VCL TCanvas and some custom zooming, but result was slow and ugly). So, i natually started to look for 2D game making libraries, and Castle is one of the most known and one of the most alive.
Maybe in long term i’d better with something like ZenGL, but have no time. So, let it be Castle (even if i would probably end up only using like 0.1% of all its riches).
Delphi XE2 was dumped for few reasons.
- It is not native for Castle, so bugs are possible, and debugging a complex library is not what i can do now.
- Linux compatibility can be a good bonus, if this sketch app would make into something better. Only using FLOSS tools, another bonus.
- Me and my current boss are growing tired of each other, so chances are in few months i won’t have legal Delphi XE2 anyway.
CodeTyphon was dumped as most FPC users say meeeh…
So in the end i seem to manage makins Win/Laz64 environment.
---- some thoughts about my future otions ----
ATM i compiled Castle from Git, run the editor, opened a wiki and… like a donkey between haystacks
So, some questiones, very vague, sorry, ATM i am not sure myself where i am steering too.
-
am i right, that the editor starts with TCastleWindowBase just has no options to start with LCL form and TCastleControlBase? Maybe engine could create some abstract “scene” that could easily get replanted into TForm after being designed?
-
Were there any experiments to channel 2D output somewhere? Like, into remote computer (VNC? custom protocol?), into mjpeg/mpeg4 movie?
-
is Castle’s user inputs processing bound to the TCastleWindowBase window? Event loop remarks at “Engine control to put on Lazarus form” article suggests so… In the end i might end up with a somewhat weird setup for the application: General scene setup window (LCL or VCL) active before/after the simulation test run, simplistic user controls window for those test runs (LCL or Castle 2D, not sure yet), and an optional 2D scene window (with or without zooming, not sure yet).
Such a disjoint “floating/docking windows” design is common for business applications (Lazarus itself), but hardly for games apps. So, here be dragons…
OTOH for the first sketch i was thinking about a single LCL form app, having three sections (alRight “setup” panel, “alBottom” user control panel, and “alClient” 2D scene.
-
the visual objects would probably be some simplistic mark (diamond, rect, circle, triangle, or maybe a bit more complicated, but not much) overlapped with some “radiation” hint, something like a translucent “function radius(angle)” background. Those to be smoothly rotated and/or moved. One user-controlled, others probably scripted. Of the two 2D Games approaches outlines, i dunno which to try first. Maybe to start with “imperative” one if it is simpler, then later to re-do it in “declarative” fashion.
-
What about multithreading? Delphi VCL is a single-threaded library, but how you spawn background worker threads is well-known. Probably the same is with LCL, as that is a reasonable design for “buiseness apps” and as LCL was made to mimic VCL. Not sure about TCastleWindowBase.
That said, i am not sure i would actually need multithreading. It might end-up cross-threads communication would introduce some latency/synchronization issues comparing to a single hi-res (in time dimension) thread design. Or maybe, given modern CPUs, there would be just no human-noticeable difference between those.
Surely this is totally not what Castle Engine was designed for, and also is very very vague, but if someone has any advices or cheat-sheets it would be appreciated.