#💀 Cortex Engine

1 messages · Page 3 of 1

void condor
obtuse burrow
#

nice, must be something on my end then

void condor
#

ah better

obtuse burrow
#

there's also a dedicated GC zone I added but commented out which could probably be enabled now (see __hxt_gc_start and __hxt_gc_end)

#

wasn't too sure what to put in it's location data, its not really that important, the interesting part is knowing how often and how long it takes so I just set the function to the gc_start one

void condor
#

added them. currently thinking.
Here is something other, if the paths are absolute then we get source preview

obtuse burrow
#

I though of that the other day and as a test prefixed a string to the file sent in the source info struct so the paths to the .hx files were absolute

#

unfortunately it didn't seem to work, I didn't get the source preview for haxe files and I didn't get the option to open the source file in some of the other views

#

guessing it only supports c & c++ header and implementation files

void condor
#

it works for me with the std haxe code

#

check the last screenshot 😄

obtuse burrow
#

ah, right, so it does

#

I'll see if I can find the bit of UI I was thinking of

#

this zone info window, I wasn't getting that "Source" button in the top right for haxe zones even if the path was absolute

void condor
obtuse burrow
#

wot

void condor
#

This is bonkerz

#

I love it

#

Here you can see which thread actually collects

obtuse burrow
#

just modified the cpp generator so that the stack frames file locations are absolute instead of relative

#

so you might get those preview and source navigation stuff for all haxe code

void condor
#

you have this in a fork?

obtuse burrow
#

just pushed it to a branch, you'll be able to download the compiler binaries once the CI has ran

void condor
#

cool

#

damn we are going fast. I need to update the docs/PR real quick

obtuse burrow
#

if that change works well I'll give it some more testing with other hxcpp stuff (I believe the hxcpp debugger uses that stack info) to make sure it hasn't broken anything and open a PR to the compiler

#

I'll then have to update my stashed memory allocation tracking stuff to go with the new structure

void condor
#

ok, just tested your preview

#

Some classes that are directly in my project received a full string, but anything else is just cut off at the toplevel

#

GC::new linenumbers seem to be incrementing

#

happens to some of my classes as well, even overflowing

#

this is a cppia compile with -D HXCPP_STACK_TRACE -D HXCPP_STACK_LINE and the host -D HXCPP_TRACY -D HXCPP_TELEMETRY -D HXCPP_STACK_TRACE -D HXCPP_STACK_LINE

#

checking the native compile now

#

ok, a lot more absolute paths local to my project now. most stuff is still toplevel relative. GC:new linenumber still incrementing, that seems like a bug.

#

it's been like that since 2013....

#

guess noone ever bothered, tells you a lot about the situation around telemetry & tooling

#

fixed in our fork

#

gah the path is also wrong. I guess this is some leftover from a refactor Hugh did

#

All this just proves the value of a proper profiler integration. it makes all that stuff visible

obtuse burrow
#

this define also only worked with files in the standard library, I've updated it so user files should also be absolute when using that define

obtuse burrow
#

I got rid of that stack frame entirely in my local changes as when I was messing around with allocation tracking "GC::new" would always be the allocations stack preview which isn't very useful

ionic badger
#

wow this is lovely

pearl slate
#

so much crazy progress - looks amazing

ionic badger
#

the amount of logging tracy has lags my app

#

its quite crazy

pearl slate
#

does that affect the metrics?

ionic badger
#

I have no idea

void condor
#

at a certain point, yes

ionic badger
#

crap :D

void condor
#

You will saturate the sender-thread

ionic badger
#

Maybe this is a bug

#

I closed my app but tracy continued to run

#

had to kill the terminal/task

void condor
#

Yes, the app will stay around till it has send everything to the profiler

#

or you click stop in the UI

ionic badger
#

oh wow, then it was seriously saturated

#

because it was hanging around for a good 30 secs before i decided to kill the terminal

ionic badger
#

tracy is receiving no new data but it is still connected to my app even though the window as exited

#

yeah app cut off at 30secs

#

maybe something to do with ceramic?

grizzled laurel
#

Holy Mother of god that is alot of data

void condor
#

hmm, maybe we have a bug somewhere. Maybe we need to profile the profiler

#

😄

void condor
void condor
#

Please note that the Tracy UI app is for interactive profiling, you can also run the cmdline version to capture and save data to disc

#

and the load&review that via the UI app

#

The documentation has like 30 pages about the UI and how to use it

void condor
ionic badger
#

if it helps I have an i7-9700k

#

on board graphics
32gb ram
m.2 ssd

#

just for some context to 'performance'

void condor
#

ok, I found the problem Im having. It's related to haxeui canvas drawing. It just creates tooo many calls into haxeui killing my performance

#

when it creates all the stacktraces it crashes the FPS

#

I added 2 more compile defines: HXCPP_TRACY_NO_EXIT & HXCPP_TRACY_ON_DEMAND
@obtuse burrow First one is for short lived apps (see docs)
@ionic badger Second one will only generate profiler data when there is an connection active otherwise no data is generated

#

just pushed

void condor
#

Yes, now I get it. We are sending a callstack for every zone. Callstacks should be optional

void condor
#

When we send them, we also include at least 5 entries per stack that we dont need

obtuse burrow
clear dome
#

👀

obtuse burrow
#

getting somewhere with non large alloc tracking

#

saw tooth has turnt into a "shark fin" due to needing to make a separate tracy free call for each alloc

#

but this is also a worse case scenario (while true loop just making random allocs), so not indicative of usual program usage (hopefully...)

#

something also seems wrong with the reported alloc sizes in that wndow. 20 - 30 bytes seems awfully low when my alloc spamming code is this...

function do_allocs() {
    final size  = 1024 + Std.random(2048);
    final bytes = Bytes.alloc(size);
}
obtuse burrow
#

got it figured out, added a new __hxt_gc_alloc to get generic allocation info, the one downside of tracy is that we can't do anything GC specific. So the existing hxt function which differentiate between string, object, and array allocations aren't that useful to us.

void condor
#

very cool!

void condor
#

added new define HXCPP_TRACY_INCLUDE_CALLSTACKS, by default callstacks wont be included and the default profiling should be more friendly for @ionic badger . People can use the new define to explicitly switch them on

void condor
obtuse burrow
#

I was hoping to get large allocs back up and working but I did something and now its all playing silly buggers with me

#

so both small and large alloc tracking currently doesn't work and I didn't commit after getting small tracking done...

#

problem for tomorrow evening

void condor
#

take it easy, we are ahead of schedule

void condor
# obtuse burrow problem for tomorrow evening

Concerning Tracy, I see 4 more things left to be crossed off the todo-list:

  1. I have to test the absolute path PR
  2. Add your memory tracking
  3. Somehow expose the TracyC macros to the user(maybe even externs), so he can create custom app-specific zones
  4. review/revise the feature compilation flags so everything make sense from a user's perspective
  5. Create a haxe PR for a cpp.tracy.TracyTelemetry.hx that exposes the globals and write some docs
    (6. Bonus: Add & Test the screenshot capabilities)
grizzled laurel
grizzled laurel
#

Epic!

#

Really cool stuff you guys are working on!

void condor
#

thx, should be a cool result with lots of benefit for the community

pearl slate
#

massive benefits

grizzled laurel
#

massive doesn't even begin to cover how benefitial this will be

obtuse burrow
#

sorted out the allocation tracking, I just hadn't read the tracy pdf page on unique pointers which solved all my issues

#

allocations are split into either the SOH (small object heap) or LOH (large object heap). does not currently work with any GC settings which cause objects to move (GC_MOVING, GENERATIONAL)

#

using the memory window you should be able to filter by the small or large heap and see all allocations made

#

depending on how taxing this is we may want to lock it behind some sort of define

#

outside of working with moving GCs there are several other bits of info which might be useful

#
  • tracking roots and pins since they cause objects to get retained and have to be manually managed.
  • for the generational GC displaying each generation as a different graph
void condor
#

hoooly shit that is useful

void condor
#

when I start the ui-app and have it wait for a connection and then start my app it seems to run into this. Doesnt happen with on-demand profiling

obtuse burrow
#

hmm, I thought I solved all those issues...

#

try commenting out the tracy macros which track large objects and see if it then works fine

void condor
#

yep

obtuse burrow
#

large objects can be placed into a special recycling list and re-used in between GC collections. I wonder if you've got a large object being re-used before a GC collection which would cause it to call the alloc macro twice

void condor
#

that made a difference

obtuse burrow
#

I'll look into some smarter large object recycling tracking then

obtuse burrow
#

just pushed a change which might help with that issue

void condor
#

nope, still happening

#

If you feel like checking addresses I can send you the saved trace 😄

#

dm'ed you the trace. It's cortex starting up and analyzing its assets

#

like 4 GC-cycles in & LOH worked heavily

obtuse burrow
#

thanks, I'll take a look. think I might also be able to trigger it with some carefully crafted byte allocations as well

void condor
#

added HXCPP_TRACY_MEMORY to enable/disable the memory tracking

void condor
#

effing gamechanger when looking at zones

void condor
#

omg, didnt test shader editing & hot-reloading ever since I rewrote the resource management. This is soo much fun now

clear dome
#

new hxcpp release with all those cool stuff, when 😄 ? (looks awesome)

void condor
obtuse burrow
# void condor like 4 GC-cycles in & LOH worked heavily

think threading is involved in this problem. large objects are tracked by the global allocator in hxcpp but I was tracking them with our per thread telemetry object. This could lead to situations where two threads get the same large object pointer since its been recycled but they don't know about each other so each issue a tracy alloc event

#

I've now switched over to tracking large objects globally, hopefully that will solve things

void condor
#

I think we can remove the GC zone since we have a valid GC::collect parent

void condor
void condor
#

Hey, is there a way to bypass hx:String in extern functions? I wanna essentially create a string at compiletime for a const expr

#

goal is to use the tracy macros directly for cases where the user wants to tag a certain zone

#

I can prolly write a haxe macro that assembles an untyped __cpp__('ZoneScopedN("my custom zone")')

obtuse burrow
#

hmm, can see how thats a pain

#

easiest might be to create a macro which extracts the string literal and places it in that untyped call?

void condor
#

yep

#

I have that working, but I cant get the include to follow the macro call around

obtuse burrow
#

might want to construct the tracy::SourceLocationData struct ourselves, otherwise we get cpp file and line data

obtuse burrow
#

can't really create a __hxt_zone function either as the RAII stuff means if will just profile that function...

#

and requiring the user to manually stop the zone is a pain

void condor
#

lemme think what I would wanna use this for

obtuse burrow
#

that ZoneScopedN macro expands to

static constexpr tracy::SourceLocationData __tracy_source_location54{ "test", __FUNCTION__, "D:\\programming\\haxe\\hxcpp\\src\\hx\\TelemetryTracy.cpp", (uint32_t)54, 0 };
tracy::ScopedZone ___tracy_scoped_zone(&__tracy_source_location54, true);

so ideally we'd do something like that but fill in haxe file and line data instead?

#

could be done in a macro or a bit of untyped to fetch the current stack context and inspect that

#

Don't know what the lifetime of the source location data needs to be for the scoped stuff

#

maybe it doesn't need to be static / outlive the scope

void condor
#

On my list there are 2 use-cases:

  1. As a user I want to be able to mark special zones in my application code emitting Haxe source-locations
  2. As a user I want to be able to mark special stuff in native / extern code using tracy directly, emitting cpp-code locations
#

let's question case 1 given the fact that the current implementation already maps your full app on the haxe-side if telemetry is on

#

concerning case 2, I think we just let the user figure out how to get ahold of the header, since it's an advanced use-case anyway

#

thoughts?

obtuse burrow
#

yeah, letting the user include the tracy header someway for 2 sounds fine

void condor
#

ok, how about we skip these scopes then

#

cause then all that is left is more testing, clean up and docs

obtuse burrow
#

might be easiest for now

void condor
#

ok

#

on to the next issue then

obtuse burrow
#

I've noticed that as well sometimes, not sure what causes it

void condor
obtuse burrow
#

ah, right

void condor
#

Im not sure if it's a problem, but interestingly it's not present in the branch that uses ___tracy_emit_zone_begin_alloc_callstack

#

I guess I can disable telemetry, add tracy_enable and compare it to our very first StackPosition Hack

obtuse burrow
#

PDF says "Zone trace, taking into account the zone tree and call stack information (section 3.11), trying to
reconstruct a combined zone + call stack trace(85)"

#

with footnote 85 being "Reconstruction is only possible if all zones have complete call stack capture data available. In the case where that’s not available, an unknown frames entry will be present."

void condor
#

ah!

#

good spot!

#

this is sooo good now. Drilling down on all the allocations per zone is sooo cool

obtuse burrow
#

I pushed a new commit for that 20ish minutes ago which hopefully improves things and doesn't break anything

void condor
#

no issue so far and LOH tracking resembles the gc-counter graphs again

obtuse burrow
#

still need to think about what (if anything for now) we do for allocation tracking and GC options which cause objects to move

#

that compile error is probably fine since those options aren't enabled by default

#

but I'd like to get it working at some point

void condor
#

hmm yes, gc behaves pretty differently in those modes

void condor
obtuse burrow
# void condor

that image does remind me it would be nice to be able to name threads

void condor
#

lemme check

obtuse burrow
#

tracy does expose functionality for that, so we could add some sort of __hxt_name_thread function

void condor
#

will do

#

feel free to lemme know what else you wanna include in the first release

obtuse burrow
#

but also, might be worth checking if tracy peeks into the platform specific API to see if the thread has a name already (can set one with win32 iirc)

#

so it might be a nice general haxe improvement to be able to create a thread with a name (will benefit debuggers and other tools as well that way)

obtuse burrow
void condor
#

just realized that profiling might work out of the box on rooted android devices and ios(albeit limited in options)

void condor
#

ok, guess what's left is reviewing / renaming the HXCPP_TRACY_* defines + docs

obtuse burrow
void condor
#

I'll have to prepare a PR draft for adding cpp.vm.tracy.Telemetry.hx to std

obtuse burrow
#

ok, just pushed a commit which does a few things

#
  1. It adds a new hx/TelemetryTracy.h header which includes all the tracy stuff and has the __hxcpp_tracy definitions.
#

this should allow anyone making hxcpp externs to add #include <hx/TelemetryTracy.h> and have access to all the hxcpp and tracy stuff

#

It also adds a HXCPP_TRACY_ZONE macro function which should add a named tracy zone with the provided ::String and current stack frame

#

this is designed to be called from haxe generated cpp files as it assumes the presence of a _hx_stackframe variable, so we need some extern to expose it to haxe

#

take a look at the __hxcpp_tracy_test_zone function I added to see usage / view the macro expansion (should be removed if / when were happy with all this)

void condor
obtuse burrow
#

yea, just spotted that as well, seems I had some arguments the wrong way round

void condor
#

strange, it only cuts "Test", not the other one

#

this could explain why

obtuse burrow
#

I'm using the length value from the optional utf8_str function, maybe that doesn't include the null terminating character in the length and tracy expects it does? so off by one?

#

although it seems to be working fine for me with my latest commit

void condor
#

ó.Ò

#

2 secs

obtuse burrow
#

not cut off in the zone view

void condor
#

I have this one zone that is cut off after 3 chars

#

wtf

#

Are you testing multiple ones?

obtuse burrow
#

no, I'll try that

void condor
#

like I just threw a few around my code

#

try multiple in the same file

obtuse burrow
# void condor

I started getting these but as errors instead of warnings, now pushing a fix

void condor
#

ok, so im not crazy

#

😄

#

looks like we are constructing a string with an overflowing / invalid length in that macro

obtuse burrow
#

think its related to the utf8_str call, I used name.length instead of the length that function gives and it appears to work

void condor
#

also, are you missing a param in utf8_str?

obtuse burrow
#

or, I should be

#

utf8_str outputs a length of 9, which explains why its cut off

#

going to confirm that the second utf8_str arg is actually length...

void condor
#

hmm I see that the pointer to the length enter the function with a dereferenced value of 3 and length 8 should be assigned, but it returns and the length stays the initial 3, explain the FOO for me. but that means that maybe something is out of order. lemme try something

#

precedence

#

got it

obtuse burrow
#

nice!

void condor
#

almost killed myself with a rebase

#

pushed

obtuse burrow
#

😂 I don't want to know the number of times I've accidentally nuked changes with a rebase

#

ah, right, that extra boolean argument in utf8_str

void condor
#

that's optional

#

i think we ran into some undefined behavior of our compilers

#

Order of evaluation of any part of any expression, including order of evaluation of function arguments is unspecified (with some exceptions listed below). The compiler can evaluate operands and other subexpressions in any order, and may choose another order when the same expression is evaluated again.

obtuse burrow
#

lovely! sounds like perfectly sensible behaviour...

void condor
#

so sometimes the pointer was written before utf8_str other times not

#

glad we caught that

obtuse burrow
#

remembered we had issue before with the getDepth function of the stack context with cppia. So I've just added a __hxcpp_tracy_get_zone_count function to get the size of that tracy zone vector and have the macro use that, just in case

void condor
#

right, cppia, that will ofc fail

#

currently the zoneScoped will inline that macro in wherever scope it is used, in cppia the macro needs to wrapped and thus will cause a wrapped call + location

#

but it's an ok tradeoff since you can use the timings of the wrapper zone

#

i guess

obtuse burrow
#

yeah, not sure how you could make it work the same on cppia, RAII and needing a wrapper function makes it difficult

void condor
#

NOONE USES CPPIA RIGHT? 😄

ionic badger
#

how's cppia's performance at runtime? 😂

void condor
void condor
ionic badger
#

maybe i'll play with it one day

void condor
ionic badger
#

but i've had this passive idea of a haxeui builder, where the compile times are low

#

a gui for building layouts

void condor
#

coz then haxeui and it's huge inheritance tree can be compiled into the host and properly used from the script-side

ionic badger
#

build it in an editor, copy paste the xml/styles to project when done

void condor
#

haxeui cppia compiles are pretty stable around 3-4 secs for me

ionic badger
#

your project here has certainly brought that idea up to the surface

#

because this would just be basically a "just haxeui" app i suspect the build times would be lower as well

void condor
#

it depends a bit on haxeui's macros, since they steal most of the compiletime

void condor
ionic badger
#

it would require some POC to figure out the value

#

but some tool to make building UI easier, would be nice

void condor
#

All that is left now is cleanup, renaming a few things and docs

#

Hereby I declare a feature freeze

#

@obtuse burrow seems like we are scaring folks! blobmeltsob ❤️

void condor
#

lolol, couldnt have thought of a better gif

void condor
#

I think I mentioned this before, but just browsing around makes me soooo happy

#

hahaha

clear dome
#

"I understand"

void condor
#

there is nothing quite like having a business breaking bug at work on a friday 5pm...

ionic badger
#

oh no lol

void condor
#

was cool, at least I was able to fell like the guy in charge on the floor again. Been awhile since I had jump into production and get the shit rolling again

#

just finished all the documentation so folks can attach/pick up monday. Now I can think about the weekend

grizzled laurel
#

every company

#

it always goes wrong at that exact time and day

ionic badger
#

i wonder how much of it is "the issue was identified at 12pm, but we ignored it, hoping we could leave on time today"

#

only for it to grow and have to be dealt with at 5pm

obtuse burrow
#

this is why lots of the UK observes POETS day

#

can't have problems at 5 on a friday if everyones buggered off by 3:30

grizzled laurel
#

Hey i'd like to report a problem

#

when using tracy the memory usage goes up like mad

#

With tracy:

#

without:

#

Not sure if this is intentional or not, but this is what happened

#

it was climbing with like a gb per second

void condor
void condor
#

when compiled with tracy enabled your app will collect/buffer all data till a connection is made to a backend (tracy ui-app or cmdline), then it will start sending & release the memory again.

#

if you only want to collect & profile when there is an active connection, then use HXCPP_TRACY_ON_DEMAND

void condor
grizzled laurel
#

ah then that was the problem

#

sorry for taking your time!

grizzled laurel
#

Also, i'd like to thank you all once again for the work you guys did

#

this is crazy good

void condor
void condor
grizzled laurel
#

cppia fixes??

#

jo???

void condor
#

dont want this too pollute std too much

pearl slate
# void condor <@456226577798135808> You wanna test this as well

ill certainly check it out, but ive also "moved past" cppia as an idea and am weary of falling down, yet another, rabbit hole. I do have a question though: @obtuse burrow - are you on the compiler team? Are you a kind of hxcpp maintainer? Apart from hugh himself i dont know anyone who is as knowledgeable about the internals.

obtuse burrow
#

No, I'm not on the compiler team, but I guess I have stumbled into maintaining hxcpp

#

mostly just add / fix things when I want / come across them myself

void condor
#

Now I need to update the included documentation. Then I prep the annoucements and we can move everything out of draft

void condor
#

you dont "just fix things in hxcpp", you bend space and time

void condor
#

[showcase] Happy to announce that our PR to integrate support for the Tracy profiler is out of draft and can be reviewed now: https://github.com/HaxeFoundation/hxcpp/pull/1153

It allows you to inspect, profile & optimize your hxcpp apps on a whole new level.
If want to see this become a part of hxcpp, be sure to leave some love & feedback & emojis for us in the comments ❤️

GitHub

Problem Statement
As a Haxe developer I want to be able to reliably profile the performance of my engine & hxcpp apps in a ergonomic, lightweight and battletested manner.
I have looked at H...

crystal grove
#

“Oh they finished, that’s coo— 46k LoC in like a week jeez”

ionic badger
#

If you're ever concerned that AI will take over, just remember that people like Daz and Aiden exist

molten sleet
#

💀 Cortex

pearl slate
pearl slate
grizzled laurel
void condor
void condor
pearl slate
void condor
pearl slate
#

... works for me... i take it all back... clearly human(s) 🙂

void condor
#

enough ai for today

pearl slate
void condor
#

what makes it worse is that this runs at 30fps

void condor
#

virus detected

#

lol

void condor
#

setting up ocaml & opam is such a clusterfuck

void condor
#

TFW when you install the recommended cygwin setup for ocaml/opam and then opam tries to run curl with windows paths instead of the environment's...

obtuse burrow
#

oh yeah, ocaml and opam is a shitshow on windows, never got it to work

#

anything requiring mingw, cygwin, or any of those sorts of things is an immediate red flag that its going to be very precarious

#

I do development / basic testing on WSL, then push to github and let the CI do the work when I want a windows binary

void condor
#

how do I switch a context from 32bit to 64?

#

like my opam thinks I wanna do 32bit builds even though I installed everything 64

void condor
#

...

#

LIKE WTF MAN

grizzled laurel
#

time to bump the haxe in haxe PR

#

XDDD

void condor
#

ok I just realized, defender only complains about the installer, not the compiler

void condor
#

gah, backend needs to be included

#

ok, then core and backend in the host and the rest in the script

#

ok, didnt have the effect I was counting on. Good news is that nothing broke for me

#

there are some changes to core that i need to review in my backend, cliprects in hui seem to have changed

#

we should then get a review from Hugh for you fix then

#

I dont think it hurts or will cause a regression

pearl slate
#

defo seems like its the right way... i havent tested it myself, but if 2 out of 3 says it works, thats enough for me (plus i dont want to go down the rabbit hole of trying to build haxe on windows 🙂 )

pearl slate
void condor
#

hmm, turns out I had an inverted normal in my shader. Now the materials finally look closer to what they should look like

void condor
#

@vapid mortar Now I got it back together: Adding a component multiple times to an entity under different types will screw with FastEntitySet._setMap causing activations to only fire per entity for the first view and not per entity-view combination.

#

I might be talking out of my ass about the way I trigger this, but I can see that the !(this->_entities->_setMap->exists(id)) in addIfMatched will only work once

#

still digging through the macro dumps to get the bigger picture

void condor
#

nah, dude, this is such a brainfuck

#

I gotta trace out the whole initialization of systems and views so I can track this down. In essence, I dont get all the activations for certain component combinations

void condor
#

@obtuse burrow ever messed with fibers?

obtuse burrow
#

In tracy? no. Saw in the docs its how they support cooperative multhreading, so when coroutines are more developed I want to take a look

#

because the profiling graphs will be meaningless without it

grizzled laurel
#

Today the Direct3D and HLSL teams are excited to share some insight into the next big step for GPU programmability. Once Shader Model 7 is released, DirectX 12 will accept shaders compiled to SPIR-V™. The HLSL team is committed to open development processes and collaborating with The Khronos® Group and LLVM Project. We’re sharing this […]

void condor
grizzled laurel
#

nice!

#

altho honestly

#

best part of the entire post is the banner on the embed xD

#

just kidding, directx adopting spirv is really nice

void condor
#

finally completed my first shader cleanup

#

also learnt a thing about bgfx: for some reason the camera position in the fragment shader is always nulled under u_invView[3]. Which is kinda weird and a difference in the targets compared OGL(works) & Vk&Dx11/12(doesnt work)

void condor
void condor
#

Im so used to pull everything out of matrices instead of using custom uniforms that I completely missed this. yay

#

this is also the reason why most bgfx samples use unnecessary matrix multiplications to get like vec3 weyepos = mul(vec4(0.0, 0.0, 0.0, 1.0), u_view).xyz;

#

since, for whatever reason, they dont wanna mess with #ifdefs for the different apis

void condor
#

gaaah, I strongly feel compiling textures via bgfx's texturec tool might be a bit too slow for my taste. what do you think?

ionic badger
#

it is slow but it is also 'in place' which is a big pro in itself

void condor
#

hmm, guess the texture is also quite big and gets compressed

grizzled laurel
void condor
#

Found another multithreading issue by looking at a crash in Tracy. This was one of the issues that would have taken me 6 hours to find before. With Tracy literally 2 minutes

void condor
void condor
#

hmmm, hmecs carries soo much static state

#

between cppia application reloads that shit sticks around

void condor
#

@vapid mortar Ok, I dug through this and found the core of my issue with missing activations callbacks. hmecs doesnt really support having multiple components of the same type on one entity. first time activation works, but second time we skip since the Fastset's setMap already contains the entity id. In my case it was "sort of" working in updates since I added the same component twice as different types and the last stored reference in storage received the update.

#

now I gotta think

void condor
#

ok, after some more evaluations I found https://github.com/Dvergar/OSIS and wrote another bunnymark to compare it against a plain code impl & hmecs. turns out it's way less code, just as fast and allows for more finegrained loops. Only downside is a huge cost for adding components to entities but I fixed this by using hmecs's FastEntitySet. Now this is promising

GitHub

Entity Component System with network support (for haxe) - Dvergar/OSIS

ionic badger
#

did you ever give aidan's a try?

void condor
#

nope, it has too much magic

molten sleet
#

💀 Cortex

void condor
#

I wanna cut down on macros

molten sleet
#

i love macros

ionic badger
#

lol

crystal grove
#

Post-macro era

void condor
#

macros are like an exotic spice. awesome in small doses, horrible if you overdo it

#

in some cases they can result in huge amounts of generated code. hxgodot is definitely guilty of this

grizzled laurel
#

Still totally stand by that statement today

#

Macros can be nice, really nice even

#

But very off-putting at times, especially for new contributors

#

Questions like "where does this variable come from" or "how on earth is this even possible" are thoughts I've had on codebases that make crazy use of macros

void condor
#

why do you think it was initally called "macro-magic" 😄

grizzled laurel
#

For you, what has specifically made you want to turn down the use of macros, surely something must have activated you to do so?

void condor
#

I dont turn them down. I just reject too much complexity for stuff that shouldnt use much code in the first place

#

Here is a fun experiment:

# ecs1
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Haxe                             3            229            250            751
-------------------------------------------------------------------------------
SUM:                             3            229            250            751
-------------------------------------------------------------------------------

# ecs2
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Haxe                            24            389            423           1956
-------------------------------------------------------------------------------
SUM:                            24            389            423           1956
-------------------------------------------------------------------------------

# ecs3
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Haxe                            28            800            514           3939
-------------------------------------------------------------------------------
SUM:                            28            800            514           3939
-------------------------------------------------------------------------------
#

all 3 systems solve the same problems. between 1 & 3 ergonomics are about the same (you need to setup components in a certain way, amount of work is about the same). 1 has about 30lines of macros, 3 is like 80% macro code. 1 has a simple way of accessing and customizing everything, 3 completely hides the details and you need to modify the macros to gain access to stuff.

1 and 3 have the same performance.

#

gonna pick 1 ofc.

grizzled laurel
#

Yeah

#

That's an easy epick

void condor
#

oh I lied

#

1 doesnt solve the same problem as the others. It includes aditional networking

grizzled laurel
#

ah

#

well in that case, imo it would depend

#

how all-in are you on networking

#

and, even if you aren't now, could you use an option optimized for networking in the future while keeping the same API

#

anyhow

#

what would you decide for

void condor
#

I guess the right way to describe my approach: less code/complexity == easily hackable

grizzled laurel
#

yeah i guess same here

void condor
#

and I wrote linc_enet back in the day

grizzled laurel
#

that is really cool 😄

void condor
#

so I can hack it if I should need it. But no priority at the mom

void condor
#

Back in macro land, gotta re-read some hxgodot macros that i totally forgot. Hilarious how little macro stuff sticks in my head

grizzled laurel
#

Oh god

#

Good luck

void condor
#

Need to tweak the macros for the ecs a little to test something. The code seemed a little familiar, then I see this.... 2019 called 😄

grizzled laurel
#

2019 was quite the time

#

I remember we were all like "oh shi pandemic in China"

#

"surely that won't come our way"

#

And then it appeared quite literally EVERYWHERE

#

Apart from that 2019 was good tho

void condor
#

barely remember

void condor
#

best generated macro code I read today:

fallow bridge
#

wha-

void condor
#

exactly 😄

molten sleet
#

cast cast

void condor
#

I think this is a bug in the macro printer when doing dump=pretty.
Original code and generated cpp:

ionic badger
#

` isn't a valid var name is it? lol

void condor
#

Question to all you ECS folks: Adding multiple components of the same type to an entity, is this something you usually allow or not?

#

Like an entity that should have 2 sprites

ionic badger
#

Hmm, i'm struggling to think of a place where I do this

#

generally if i have "related data" though, i'd group them in some container

#

like an enum or whatever

void condor
#

my take atm is that it should be allowed

#

cause the entity is supposed to be the "group"

ionic badger
#
    @:fastFamily var values:{first:Test, second:Test};

    override function onEnabled() {
        universe.setComponents(universe.createEntity(), ({a: "foo"}:Test), ({a: "bar"}:Test));
    }

    override function update(_dt:Float) {
        iterate(values, (entity) -> {
            trace(first.a, second.a);
            universe.deleteEntity(entity);
        });
        }
#

A quick test on aidan's ecs

#

and this seems to fail

#

there might be a technical limitation here?

#

What happens is first.a traces as bar and second.a traces as bar

#

so the last thing overwrites the others

#

same thing occurs with a string entity

void condor
#

Guess it's the usual 1:1 mapping between entity & component that is assumed in their storage container

ionic badger
#

good to know tho, the fact that it isn't immediately an "error" but fails somewhat silently is nice to know

void condor
#

yeah, part of the origin of my question. None of the libs seem to test/validate for this

ionic badger
#

i guess it likely adds a decent chunk of a complexity

#

but realistically i could see it being quite a useful thing in general, like collision between two objects

void condor
#

in my case I have a transform cmp and multiple other cmps that want to access/share that transform's matrix

ionic badger
#

currently i'd just wrap it in an enum because i only really want the "ecs" to be a kind of "data mover"

void condor
#

But this forces everything to be hardcoded, assembling entities at runtime can no longer be data-driven (think inside an editor)

#

I have a mesh and I wanna add a debug display axis aligned bounding box to it, both being a "renderable"-component, I'd have to code that and write a new cmp

#

or create a whole new independent entity for it

#

duplicating matrices and shit

ionic badger
#

well that's why an enum is okay, cause its not too much of an investment

#

however i've been seeing some issue with my use of the ecs, but hadn't quite figured it out i'll keep this in mind and see if i can figure out what it is

#

its just so minor its only "in the distance" so its hard for me to really put much time into figuring it out 😂

#

but it may be something like the fact that I may be wrapping things more than I need to (or should do)

void condor
#

hmmm

#

Who is the troll that adds/removes reactions here.

ionic badger
#

@fallow bridge

fallow bridge
#

whats wrong with adding the 🤓 emoji if i may ask

ionic badger
#

chances are, daz probably keeps trying to see who is reacting

#

but by the time he gets there, the emoji is removed lol

fallow bridge
#

oh well

void condor
#

What's wrong with inserting yourself into shit you dont contribute to?

#

rhetorical question

fallow bridge
#

everything

void condor
ionic badger
#

ahh

fallow bridge
ionic badger
#

waste of time

void condor
#

hmm i could introduce collection-components

iron path
crystal grove
#

Aidan’s ECS and a few others are just arrays of components with entity indices. I don’t think I’ve seen a case of “component group” that wasn’t explicitly a group component

#

I’ve def run into that case though where you need to restructure just bc you now have two Rects as components. With Aidan’s, iirc you could abstract over one and that counts as a new component type

void condor
#

got it figured out for the moment

void condor
#

that LD collab thread....

#

really need to hold back or Im gonna scream. Communicating Visions is such a simple but very hard thing to do

grizzled laurel
#

especially in text...

#

even with tools like exaclidraw

void condor
#

It's not the form or the tools. It's the content. It takes empathy and switching perspective. Simple experiment: When reading issues or tickets, do people describe the actual problem and the criterias that need to be fulfilled to kill the problem? Or are they describing a solution without the problem? Most of the time things are completely mixed up and people get confused. Developers tend to fall into the trap of the second, almost 90%

pearl slate
#

"as a user, when i click on the export button, i expect that the thing exports correctly" (thats how ticket titles - and content - should be written imo)

#

the worst is when QMT tries to debug the ticket for the dev, and you have to remove all the assumptions and incorrect info

void condor
#

people have shit in mind even if they write very good stories, but they cant or shouldnt pack everything into the story sentence

pearl slate
#

certainly, i mean the title... obviously the content should go into reproduction steps, etc. But the start of tickets (in general) should be "as a user, or as a X", not "as a dev" or "as test who thinks they know"

void condor
#

yes, personas are super important!

pearl slate
#

"As a pathologist, i expect the READ codes to be organized by relevance, not alphabetical order" (real ticket - paraphrased)

void condor
pearl slate
#

is was defo in the ticket

#

anyways, just agreeing with you basically 🙂

void condor
#

top notch then. I had a hard time re-learning that with my devs at work

#

Now I see it everywhere and I wanna scream

pearl slate
#

haha, yeah, i run a couple of teams (with varying results)... im not a huge fan of agile really but there are parts i defo like about it... backlog grooming, standups, retros.. etc...

#

story points can fuck off (though im forced to use them with one team)... and some of the agile fluff i could do without... ... i think a sort of not conforming "agile-lite" would be where my head is at

void condor
#

hahaha

#

I have picked a fun definition for storypoints

#

"Business-Complexity"

pearl slate
#

yeah, the problem is that it just means (in my exp.) different things to different people... and "scum poker" is just not worth it either...

void condor
#

my theory is, that you need to make storypoints super confusing only then people will start talking about the real shit

pearl slate
#

i still use story points with the NHS team, but, honestly, at this point, we just sort say "5?" yeah... whatever...

void condor
#

they are just a relative measure for a single team. The team can use them to steer its allocation over time

pearl slate
#

sure, thats what we do... ish... but we used to go way under (when we were using them "properly"), then way over, and now its like everything either a 1, 5 or 8... thats basically it

void condor
#

really, the most important thing they do, they show disparities/knowledge gaps in the team

void condor
pearl slate
#

i think its a usless metric... i dont have a better way to guage what to put in a sprint to be fair, but the metrics itself is shitty... i actually think "hours" would be more useful

void condor
#

haha

#

depends on what you are going for. we focus the problem, not the solution(get dev to understand the business-side/-case). complex business problems might have easy solutions and vice-versa.

pearl slate
#

true, as i said, i dont have a better metric, i just know from exp that, for the most part, we dont use story points "properly" because it just a PITA... is it a 5? No... more? 8... less? 1... for some reason it never goes to 2 or 3

#

basically, we just pull the numbers out of our arses in something that feels somewhat reasonable

#

which, to be fair, is kinda the point of story points... but we dont have some big discussion about it

void condor
#

sure, there can only ever be an understanding about them in the team. they are relative, only for one team

pearl slate
#

i still think "hours" would be more useful, but i get why they arent hours, because that feels more like a time promised contract type deal... but yeah...

#

if story points "went away", id defo need something to know how to build a sprint... but i still think they are shit

#

i might think about introducing them with the other team tbh... see how it pans out with a "fresh start"... i might totally change my mind

void condor
#

imo they are a cool tool to get people to ask the right questions, share knowledge and get on the same page. "hours" are really just a measure of a skill and doesnt get me the same result

pearl slate
#

true enough... my 1 hour could be someone elses 30 and vice versa

void condor
#

but that's my experience, lemme know how it turns out for you

pearl slate
#

yeah, i think its just the NHS team tbf, and we have been working together for ages so we just kinda "go with it" at this point

void condor
#

kinda sounds you hit the endgame with that team. Wouldnt worry then

#

time to add an almighty console to the engine

void condor
#

I wonder, @pearl slate how hard would it be to rip out haxe.ui.styles from haxeui-core into its own lib?

#

I guess I would have to replace / mock Component for selectors

pearl slate
#

i want to make it like propery typedefs / struct init classes / enums... so you could do:

myComponent.style.border = { color: red, size: px(1), style: solid }

(something like that anyway)

green breach
#

oo i like that

void condor
#

hmmm ok, I have a crazy idea

#

but let's resurrect some old code first

void condor
#

gaaah

#

my old shit is insane

#

literally everything is abstracted

#

you want to run a fully independent UI-Canvas with a complex UI as a texture on a 3D model? Sure....

grizzled laurel
#

that kind of stuff is cool tho

#

like want UI in VR? go for it

#

altho in my experience it can be annoying adding a bunch of boilerplate for that to work

void condor
#

Yeah, in my case I have all this boilerplate in my way when doing seemingly basic stuff

#

at least every canvas has its own nanovg context now

ionic badger
#

everyone was pretty chill

void condor
#

my old UI has such a shitty concept of component renderers

#

it inherited the concept from mint and now it's brainfucking me

#

I mean it worked nicely and you can customize it easily but its OOP shit is now fucking me with the new engine architecture

green breach
#

You aren't using HaxeUI anymore?

void condor
#

ofc I still use haxeui. But I dont wanna use it for core-engine ui stuff

green breach
#

aah

void condor
#

like the ingame console should work with or without haxeui

green breach
#

Yeah, makes sense

void condor
#

it also supports a few things haxeui cant atm. it has the bespoke 3 phase event system and doesnt use singletons, so you can have multiple independent UI apps active at the same time

void condor
#

finally

#

the whole rendering part of this ui has to go

#

@fallow bridge stop it

fallow bridge
#

ok

#

fine

ionic badger
#

@fallow bridge You recall you've been banned before right?

#

stop being antagonistic

grizzled laurel
#

Or an old project?

#

It looks sick though

void condor
#

Im basically porting/modernizing everything for cortex

grizzled laurel
#

I see, sounds good

void condor
#

I might be stripping the whole free font support out of nanovg

grizzled laurel
#

you has ideas to replace fontstash right?

void condor
#

have an idea

void condor
#

our tracy hxcpp is quite popular it seems. 49 cloners in the last 2 weeks

grizzled laurel
#

2 of which were me

#

i use tracy reguarly on both my machines

#

it has prevented me 3 headaches so far

#

1 for dumb memory usage

#

1 for dumb code

#

1 for dumb thread usage

#

you guys have literally contributed something CRAZY useful to everyone

#

im very grateful

void condor
#

It's unique cloners, so you were only counted once

grizzled laurel
#

ah i see

#

altho it may still have been 2

#

one logged in, one annonymous

#

because 2 machines

void condor
#

cleaning up a haxe port of the nanovg demo

fallow bridge
#

is there somewhere a tutorial that shows how to add tracy or do i have to do all of it myself without knowing what to do

void condor
#

It's not officially merged. There is no tutorial. You are on your own

fallow bridge
#

crap

grizzled laurel
#

It is pretty straight-forward in my experience

grizzled laurel
#

how would you achieve an outline on a bezier curve, but one that does not overlap on merging paths

#

random path

#

desired outline

#

ive tried to (and managed to) draw curves on my own

#

but i really am lost at drawing outlines

void condor
#

heh

#

added some fixes concerning text to linc_bgfx' nanovg,

#

text metrics and glyphpositions are now easier to work with

#

with that in place I can focus on the real meat of the rework next

grizzled laurel
#

amazing

#

tysm

fallow bridge
#

it actually compiled without any errors

molten sleet
#

When will the tracy hxcpp pr get merged..

void condor
void condor
molten sleet
void condor
#

I was there, it wasnt

void condor
#

can you please stop with the meme gifs here? Super distracting shit

molten sleet
#

Sorry

void condor
#

ahhh ui-coding is soo nice in cortex

#

currently cleaning up the whole internal ui lib

ionic badger
#

what is ui coding in cortex, cause i'm sure i've seen like 2/3 different ui systems lol

void condor
#

cortex will have a little internal ui lib that you can use

#

since it has no major dependencies it compiles in like a sec

#

it mimics the html event spec/as3, so attaching to complex event cascades is very easy

#

it gets a clean renderer integration now, that will likely be most of the haxeui backend

#

both share the nanovg integration but it makes sense they share a bit more like textfield stuff, which im also gonna rewrite

#

the goal is to have an animated ingame console with colored text support and autocompletion

ionic badger
#

wait so you've got a bit of a ui abstraction going on?

void condor
#

ofc, I do. I used to run custom cross-plat configurator UIs everywhere.

ionic badger
#

🤯

void condor
#

it's super lightweight

#

im just cleaning it up now and make it available as part of cortex

ionic badger
#

at some point when i've gotten my own stuff to good point, i'd like to a take a deep dive into haxeui macros

#

see if there's any ways to make it lighter on the compile times

#

but i need to understand more about macros as well

acoustic pivot
#

What is Cortex anyway? Idk if it's a pinned message bc I'm on mobile and it won't let me see them

ionic badger
#

rendering framework

#

supports 2d/3d

#

runs on bgfx

void condor
#

it's not only rendering

#

it's a 2D / 3D game-engine

acoustic pivot
ionic badger
#

ahh

acoustic pivot
#

Gimmie a sec this stupid ass fruit fly is driving me crazy asf

ionic badger
#

I guess that makes sense with an asset pipeline 😅

acoustic pivot
#

Ok killed it

void condor
ionic badger
#

you're truly building up a beast 😄

void condor
#

gonna be cool

#

if all works out Im gonna do a christmas release

acoustic pivot
void condor
#

I decided to go easy on the macros after hxgodot. macros encourage to generate a lot of code+complexity and i wanna keep things small as far as possible

ionic badger
void condor
#

like im gonna recycle the simple xml macro I used for the statecharts for the internal ui

ionic badger
#

so i think my first step would be to investigate issues I have with aidan's ecs as a stepping stone and see if i can solve some issues that rudy mentions it has with lsp

ionic badger
#

That's quite neat

void condor
#

simple local code generation, no global madness

void condor
#

muahahaha, this is going to be nuts

void condor
#

haxeui lite 🙃

fallow bridge
#

haxeui-i-cant-see /j

void condor
#

sooooooooo good

void condor
#

ahhh, I forgot myself for a little and now I implemented html display + flexbox..

molten sleet
ionic badger
#

From that perspective, the idea of 'DIY' something like everyone does in haxe is nice

void condor
#

now i know why @pearl slate wants to rewrite the haxe.ui.styles stuff... but fuck it, it works

#

now I need to port over the rendering part so we can actually see shit

void condor
#

ok, feels weird, but I can actually use haxeui xmls with slight mods in this

void condor
void condor
molten sleet
#

..how

void condor
#

magic shrooms and some hacks

#

xD

#

in essence: my old ui lib refactored for cortex, lifted & hacked the css-styles stuff from haxeui and plugged the css files into the resource-manager

#

changing the ui-tree needs a cppia compile & reload (2 secs), changing the styles / css is pretty much instant

molten sleet
#

oh its cppia?

void condor
#

it's whatever you need it to be

#

(hxcpp exclusive)

ionic badger
#

production = haxeui, dev = cortex ui

void condor
#

I dont think it can have parity featurewise, im no ui guru like ian. But at least I can recycle a lot between eachother and shit will look the same

#

im kinda torn on how control/components are built and rendered.

#

but at least now I can go through and delete a lot of code and then hook up https://github.com/ncannasse/hss into the asset pipeline for some extra magic assembling the styles

green breach
#

how tf did you do that so fast lmao

void condor
#

ah, this is soo cool now. I can focus very easily on supporting all these cools css visuals

void condor
#

I guess the next step is to promote css files to a dedicated cortex resource so they can load&register other resources as hard dependencies. That way a css file could include fonts and images that are automatically managed by the resource manager. hmmm

grizzled laurel
#

That would be really useful

#

Altough what if you have some kind of global CSS file, wouldn't that mean some resources would be kept loaded even when not needed?

void condor
#

I'd argue that a global resource that is not used shouldnt be a global resource

#

concerning css files, dont plan on having multiple css files per ui canvas. It'll be a baked css containing all styles for canvas' ui tree

#

multiple files per components, compiling css templates, etc will be part of authoring / asset time. means way less complexity at runtime

#

There is the convention that the engine should only load runtime optimized formats, in case of css files for different uis this can lead to duplication of styles, but who really cares about those strings, since we gain contained resource contexts, removing a shitton of complexity. linked dependencies like images that are used by different things will only get loaded once and reused anyway

grizzled laurel
#

Ah I see

void condor
#

hmm, i think there are some bugs in linc_bgfx debugdraw extension

void condor
#

this is such a fucking puzzle

void condor
#

stylesheets can now reference images as dependencies and shit has a proper lifecycle

molten sleet
green breach
#

since you are making a UI library from scratch, can you correct color to be text-color

#

looks really good tho!

void condor
#

haha, I know what you mean. though when it comes to css color is the foreground color that's applied to text & decorations

#

I'd like to mimic normal css as close as possible since i want it to be the primary way of setting up basic UIs in cortex

green breach
#

decorations are basically part of the text, but yeah i get you

void condor
#

and people should be able to plug in a preprocessor of their choice

green breach
#

speaking of, are you planning to port hss to haxe?

#

i know you were talking about supporting hss

void condor
#

nah, hss is still being maintained and it serves me well since it's so lightweight using neko

#

but you might as well use less or sass as a pre-processor

void condor
#

omfg, my castle fork gets PRs

#

didnt realize!

green breach
#

you are famous!

#

the joys of open source blobpopcorn

void condor
#

I doubt that 😄

#

in any case there are some cool changes in the lib I have to investigate

pearl slate
void condor
void condor
pearl slate
#

i havent followed the full convo (was a way last weekend) - is this a replacement for haxeui in cortex, or an alternative, or... .... ... ?

void condor
#

This is me on my quest of adding a no-dependency developer console to the engine

pearl slate
#

"developer console" as in, dunno, something like chrome dev tools?

void condor
#

It's the old ui lib with the web event handling I showed you at some point, undusted for cortex and added your haxeui styles modules

pearl slate
#

and added your haxeui styles modules
thats interesting... so it reuses the style sheets from, say, the default theme?

void condor
#

ingame console, you know to run commands and stuff

pearl slate
#

gotcha

void condor
#

also Variant is disabled

#

basically simplifying it a bit

pearl slate
#

gotcha, tbh, that whole sub system needs a good rewrite / refactor... that huge Style.hx class is... ... unwieldy

void condor
#

but it's ok, it gives me just enough flexibility to experiment

pearl slate
#

i think there is alot of technical debt in that class / system... its one of the original systems - and hasnt evolved much over time, just added to

#

thankfully, i think its one of the more "simple" (relatively) systems - and i dont think it should be hard to come up with something much nicer - famous last words ofc 😄

#

4 weeks later:

  • commit: better style system
  • revert commit: better style system
  • commit: better style system
  • revert commit: better style system
  • commit: better style system
  • revert commit: better style system

😄

void condor
#

Looking forward to getting your opinion on the ui lib once i release cortex

pearl slate
#

i must confess, i havent run cortex since the very simple PoC / MVP from ages ago, and since you move at DazSpeed im sure LOADS has changed

void condor
#

the event phases + filtering is something quite simple & powerfull

pearl slate
#

yeah, i still need to relook at event system in haxeui (thats one of the more complex things on the list)... time is always a limiting factor though

void condor
grizzled laurel
#

this is insane news

ionic badger
#

DAZAKAZAM

void condor
steel plinth
void condor
#

@ionic badger he is trolling again

#

im slowly pretty annoyed by this childish crap every other day

void condor
pearl slate
void condor
pearl slate
#

oh

#

so yeah, defo being a 10 year old - and a babyish one at that

grizzled laurel
#

I always wonder to myself why people do this kind of crap

ionic badger
#

when people have free time

#

they will find ways to use the time

#

whether productive or not doesn't particularly matter

pearl slate
#

meh, i would just boot them - i doubt sincerely they add anything to the server if this is their contribution...

#

¯_(ツ)_/¯

void condor
#

I really need to write some official documentation for tracy

ionic badger
#

getting prompts or for personal reasons?

void condor
#

nah, just the normal opensource stuff. People have assumptions and give very little details but want help

ionic badger
#

ahhh, yeah

#

just somewhere that says, "hey xyz is normal, read the full tracy doc here"

void condor
#

it defo needs all that info from the PR in the official docs

clear dome
#

My tracy + haxe documentation FAQ right now is my subscription to that github pull request 😄

void condor
#

just pushed a few more fixes to linc_bgfx

#

sharing textures between bgfx and nanovg is now possible. also a few more fixes to make Bimg play along with cppia&native more nicely

void condor
#

@ionic badger in case you have question concerning cppia, lemme know

ionic badger
#

i want to play with it at some point, for now, its not a priority cause i can't really use native target atm

void condor
#

time to code some more UI stuff. I need to finish this console

#

Cortex is the result of my hxcpp & cppia experiments, linc_bgfx and several other libs like important parts of my former haxe 3D engines that I never released. This time I throw everything into a blender and see what sticks. This thread will serve as the little progress log.

#

oh, I cant pin things here in the thread?

void condor
#

found it

ionic badger
#

finding ways around discord's permission limitations

void condor
#

yay, automatic layouts working

#

this being the vertical default one, next stop is a horizontal mode that can be set from css

void condor
#

ok, vertical & clipping done

clear dome
#

UI might be one of the worst rabbit hole of them all 😄

void condor
#

u bet. my convention is to have as little code as possible

ionic badger
#

it's dangerously entertaining to work through building ui's

#

there's this instant feedback you get that a lot of things don't have 😂

void condor
#

😄

pearl slate
#

UI, rabbit hole? I have no idea what you mean 😄

void condor
#

What's left is text and scrolling, then I can finally have my console

clear dome
# void condor u bet. my convention is to have as little code as possible

That's a good rule, one that I only managed to apply on userland code 😬 Many times for me the trade of has been "more code in the framework to allow less code from the user" because I want to avoid project with too much boilerplate (of course another challenge is not to make the framework too strict, well well)

#

(macros can help in the "too much code in the framework" problem though)

void condor
#

That's cheating 😄

#

fell into that trap with hxgodot. in the end I generated one million lines of code through macros

clear dome
#

But yeah even with macros you still need to be careful with bloat

void condor
#

850 engine classes that needed glue binding + a proxy class

#

glue per field etc

#

agree

clear dome
#

I guess it would have been possible to share some glue code that share the same function signature maybe?

void condor
#

The way the api interface worked, sadly it want really friendly to reuse shit

#

I STOP NOW; THAT SHIT IS BEHIND ME

clear dome
#

I see some trauma here xD no worries

void condor
#

I think the problem is that you can make UI code really beautiful & functional, that makes it so addicting

ionic badger
#

clear cut objectives

#

its like building editors, something about these things are just fun

void condor
#

this css layout approach is insanely powerfull

ionic badger
#

dude

#

what have you done

grizzled laurel
#

beautiful

ionic badger
#

it reloads so quickly

#

it was around a month ago when we were on voice chat trying to get reload times down 😂

grizzled laurel
#

don't forget, it's dazSpeed

#

of course stuff happens magically without us being able to even comprehend

ionic badger
#

God I love that reload

void condor
#

guys, I just stick to the basics, no magic here 😄

#

it just needs to reload the css and re-calc the styling

ionic badger
#

how do you switch from cortex ui to haxeui here?

void condor
#

I dont!

ionic badger
#

that's haxeui reloading?!

void condor
#

nonono

#

listen, what you see is my small ui lib that uses a modified copy of haxe.ui.styles.*

#

I have a macro that eats xml

#

it roughly behaves like haxeui xml

ionic badger
#

ahhh I thought that was the case but wasn't 100%

#

it's just really light, so its rapid on the recompiles

void condor
#

in the video there is a single cppia compile at the end when I modify the xml, css is completely decoupled from that. The engine listens for file events of resources and reloads them, and I have a dedicated resource-type for stylesheets, so it just replugs itself

#

now im debating scrollbars

ionic badger
#

lol

void condor
#

i have content sizes of the dom and now I need to decided if I do the scrollbars via css

ionic badger
#

scrollbox seems better, no?

void condor
#

whats the difference?

ionic badger
#

hmm, none

#

arbitrary distinction

void condor
#

somehow I dont want to add components for them into the tree

grizzled laurel
void condor
#

with the event system I could just intercept and steal the mouse events when the mouse is at the border of the clipping container

grizzled laurel
#

What is the reason for not wanting that?

void condor
#

in your browser the scrollbars are not part of the content

#

I feel that this makes sense

#

hmm

grizzled laurel
#

Well yea

#

But I feel like the requirements differ alot in between a game and browser

#

To me personally it would make sense for scroll to be a container

#

I understand your point but yea

clear dome
#

I agree with @void condor , scrollbars are not things that need to exist as separate elements in the hierarchy that describes the UI

green breach
#

haxeui does scrollbox, html does it in css

clear dome
#

Ah, having an actual UI element that is a scrollable thing, this seems legit though

#

I was talking about the scrollbars

void condor
#

ah now I get it

#

in haxeui you have a container/component called scrollbox.

green breach
#

yeah

clear dome
#

in Ceramic UI you have ScrollView too

green breach
#

although haxeui also has a scrollbar component

void condor
#

ok, so im gonna do it differently. any UI control that has clipping content can display scrollbars

green breach
#

ah wait, haxeui calls it scrollview too

void condor
#

might sound weird, but I think it might actually be simpler

clear dome
green breach
#

i think you will end up with a scrollview like thing, it would just be hidden from the end developer

void condor
#

input events run in a 3 phase cycle to targeted UI control. Any container along that event-path can read, react even intercept the input

clear dome
void condor
#

it depends on the css, similiar to the browser you can enable/disable stuff

#

lemme cook and see how it comes together

#

I literally have no idea

#
clear dome
#

Right now I get the idea, which seems quite similar to web browsers indeed. I'm just wondering where the event handling that does the actual scroll will be. I guess with your approach it will have to be part of the UI system itself somehow

clear dome
#

More wondering on how to implement it 😛

void condor
#

xD

#

all it really takes is shrinking the clipping rect by the scrollbar area and then you dont even need to intercept events but can add a scroll event handler to the container based on the css

clear dome
#

because with the approach of having an actual ScrollView element, all that event handling specific to scroll will just be in that component implementation

void condor
#

looking at it after a break: the event handling is actually very easy

#

we just add a listener general listener per control that consumes the event if it has clipping content

#

decided both is approaches will be possible. a simple default scrolling behavior for controls that have clipping content per CSS and for more custom stuff wiring up a vertical slider

clear dome
#

As long as you don’t need to handle touchscreen scroll it should stay simple yeah, I guess you don’t need that anyway

void condor
#

lolol, touchscreen

void condor
#

though I might be taking things a little to far, started comparing the layout algos with the browser

ionic badger
#

you're just building haxeui now 😂

#

so cool though

void condor
#

haxeui is much more advanced. I cant possibly replicate it in 1k lines of code

ionic badger
#

variables in the hss file

#

i initially read it and thought i knew what it was

#

i guess not 🤔

void condor
#

hss has support for vars & functions which get baked into the output css

ionic badger
#

and the variable name allow dashes

#

so many cool things around here in haxeland

#

2024/2025 is gearing up to be very "ui-centric" in haxe land

#

a lot of ui projects going on

void condor
#

you think so? My goal is to get out of ui code and focus on something as quickly as possible

#

in any case, the more awesome shit we have, the better. helps to grow the community

ionic badger
#

there's like 4 different "ui projects" going on currently

#

its really really cool

void condor
#

gah relative sizing is such an ass

#

added a little table-like evaluation to make height work

void condor
#

aaalmost happy

clear dome
#

Nice

void condor
#

The more I look into this layout stuff I realize how everything in the browser is tightly tied to text & document flow and why it has been such a clusterfuck

void condor
void condor
#

Saturday afternoon and im reading & comparing w3c specification documents. It's hilarious how the quality of the specs has declined over the years

#

spec from 15 years ago: "The following is an overview of the assumptions & algos that defines how event-handling should work: ...."
spec from 2024: "There are events and paths. Here are some random interactive samples. TEST YOUR SKILLS!"

#

like wtf, why am i even surprised

ionic badger
#

lol

void condor
#

lol, im such an idiot. TIL that i can use my nanovg externs as static extension, making the code much more readable..

void condor
ionic badger
#

that's so damn cool

void condor
#

There are a few more kinks to iron out, but Im almost happy

ionic badger
#

how much work went into this so far?

void condor
#

the ui is about ~2.5k lines of code

#
  • another ~2.3k lines of code for the whole css stuff
ionic badger
#

what about mental effort?

void condor
#

pretty easy going. but I dont have a lot of freetime atm

#

I think the whole ui stuff is like a week of continous work, mostly porting, validating and rewriting parts

ionic badger
#

every time i click play on the video, its like i'm watching it for the first time

#

so nice 😂

#

obviously this stuff isn't necessary

#

but its just a nicety

void condor
#

what do you mean?

ionic badger
#

a full recompile and load in is 20seconds for me

#

it isn't necessary to have the "instant"

#

but there's a certain appreciation you get for it

void condor
#

ah I see

ionic badger
#

there are times where all I want to do is change some padding

#

but I have to wait 20 seconds to see if 1px on the left is "just right"

#

in those moments, something like this would be great

#

but in the actual construction of the "meat" the wait time is actually pretty okay, you get to ponder etc

void condor
#

it's about flow for me. The whole things spans across the whole engine. One day I show off the level editing 😛

ionic badger
#

i'm sure its gonna be dazling

void condor
#

😛

void condor
#

@ionic badger randomly doodling as well

ionic badger
#

That looks epic

#

how long did that take, what did you make that in?

molten sleet
#

aritists be like "just a doodle" and its the goddamn mona lisa

void condor
void condor
#

krita got pretty good over the years

acoustic pivot
void condor
#

my whole childhood and teens was drawing

#

but I suck a color

ionic badger
#

that shading is damn good as compensation though

grizzled laurel
#

Yea love the shading on it

ionic badger
#

fan sketch

#

took 10 mins

#

recon i would have been close if i had more time

grizzled laurel
#

Great shading!

ionic badger
#

Thanks blobbowing

grizzled laurel
#

😎 You're welcome

ionic badger
#

particularly proud of the weight loss this guy had to do to make this pic happen

grizzled laurel
#

Can I hire em as my personal trainer?

ionic badger
#

Sure, you have to pay extra for him to leave the gun at home though

grizzled laurel
#

Hey I'll take a free body guard

#

He is friendly... Right...?

ionic badger
#

gun is part of the program

grizzled laurel
#

Oh

#

In what way

ionic badger
#

motivation

grizzled laurel
#

Not on me I hope

#

Oh

#

Okay

#

Yeah that seems normal

#

That's alright then I suppose

ionic badger
#

💪

grizzled laurel
#

😎