#arma3_tools

1 messages · Page 27 of 1

glossy inlet
#

I wanted -mods parameter some day ¯_(ツ)_/¯
But so mucho worko. looking up arma directory in registry? yuck

scenic canopy
#

😛

dawn palm
#

chris lutz' cupCore2P.installer is now avaliable on all subscriber webservers and the freebie server too.

#

no more getting it wrong when extracting folks

glossy inlet
#

Holy crap. https://s.sqf.ovh/devenv_2018-12-06_11-18-43.png
Visual Studio 2019. Note the annotations for what members of what struct are being set in the initializer list. This is genius. (done by resharper)
Oh btw, VS 2019 preview is out. It contains AI based code completion suggestions and Live Share

nocturne basin
#

thats resharper or visual studio now?

glossy inlet
#

(done by resharper)
It didn't do that for me in VS 2017 though, dunno why

Live Share is awesome. I'll be able to debug intercept issues by just joining peoples debugging session and helping them directly on the code :3
Also they removed the title bar of VS at the top. Makes the window feel alot bigger even though it's just a cm.

nocturne basin
#

well ... then no real useful tool for me yet in latest VS preview probably

#

even C# will be a downer if it gets released with that one

#

and resharper still is way too expensive for my personal taste

karmic niche
#

AI based code completion suggestions

Using AI for that seems to be real hot right now.
https://kite.com/

nocturne basin
#

i mean ... who the fuck comes up with such idiotic ideas!?

#

"lets retroactive break all peoples code for something that only rookies will ever wonder about"
"great idea!"

karmic niche
#

Nullable reference types? Wasn't that the point of references that they could NOT be nulls?

nocturne basin
#

C#, there are value types and reference types

#

reference types are not references like in eg. C++

#

but rather normal object instances

#

thus nullable

#

value types are non-nullable

#

and are copied everytime you pass em around

#

thing is: they want to remove the nullable capability from object instances

#

unless you mark them explicitly as nullable

#

because "so many exceptions today are NullReferenceExceptions"

#

sure thing ... so i will just start using foo? bar= new foo() from now everywhere instead of var bar = new foo() just in case i need to null my bar at some point for whatever reason

#

pretty much all what this change does, is forcing pretty much every developer to put a ? after their variables

#

a bloody solution in search for problems, nothing else

smoky halo
#

i love the feature ^^

#

makes you think about what you really want

nocturne basin
#

sure .... just that the only benefit from this is with everything that does NOT contain any bloody actual code

#

already with EntityFramework this change brings massive crap

#

code first and want another entity? well ... you have to add a ? to your class now or you get a required field for your table

#

and most code will just need to be updated to comply with it for no reason

smoky halo
#

well there is a reason: code quality. And i am pretty sure you can disable the feature

nocturne basin
#

updating already written frameworks with such "features" is PITA

#

my assumption how the introduction will work out is fairly straigth forward: All just try to add a ? via some regex onto every class available

#

done

#

and from then, use it with questionmark

smoky halo
#

if you are doing that you could simply disable it

nocturne basin
#

if you wanted a value type, you already could get one in c# without any problems

#

but this is just for rookies to actually make "life easier" for them

#

which also is bs because literally every other language treats those things as nullable

#

the only benefit i see from this, is that you now can explicitly say "this never can be null"

#

but for that case, the inverse would have made more sense for an existing language

#

things get even worse when one dives into reflection

#

former: the reason why string is no primitive, is because it is a class afterall

#

but now people will start wondering why is string not a primitive

#

same for various other types

#

Ohh and what is typeof(MyClass).IsValueType now supposed to return?
for every class still false?
why then? without a ?, classes are essentially value types that get passed via ref

smoky halo
#

this new feature does not introduce new types. the resulting IL code does not change

nocturne basin
#

what with the default operator?
default(foo) with foo having no parameterless constructor=

smoky halo
#

a reference type will be null. Nullable type: "An instance for which the HasValue property is false and the Value property is undefined." and structs are not allowed to have no parameterless constructor

fallen stone
#

nullable reference types was a long time coming, it's very good

#

Going to obsolete a plethora of libraries that had the same goal

native kiln
#
All enforcement of null behavior will be in the form of warnings, not errors. As always, you can choose to run with warnings as errors, but that is up to you.
There’s a compiler switch to turn these new warnings on or off. You’ll only get them when you turn it on, so you can still compile your old code with no change.
feral nova
#

@nocturne basin with your sqfvm, would i just useExec vm to test my extension ?

glossy inlet
#

you could also just write the code that you want to execute directly into the console window

#

just write the callExtension line like you would ingame

smoky halo
#

Should I tick "force v2" when signing mods for 1.88?

pearl beacon
#

No, v3 works fine

smoky halo
#

So, v2 is just in-case people want to use old versions of the game? Not because sigs broke and all that? 😃

pearl beacon
#

Most likely, and I am not sure what exactly broke

smoky halo
#

Heard a lot of talk about signatures breaking and being reverted to V2 in the newest update.

nocturne basin
#

@feral nova callextension

pearl beacon
#

They weren't reverted, just some additional security stuff was disabled

smoky halo
#

Ah, I must have missread the update. Thanks!

blazing cosmos
#

hello sirs. I know what I'm about to ask is DayZ related but considering the similarity of the tools between A3 and DayZ I was just wondering if anyone has ever experienced this and knows what's up. https://i.gyazo.com/9710085bdf2657d8b29850066ce4aa98.png This happens no matter what I tell it the source directory is, even copying the entire install dir to another place just to see, even changed the settings.ini for the tools changing the paths there but to no avail. Send help

glossy inlet
#

did you launch dayz atleast once?

blazing cosmos
#

uhm, I reinstalled it and completely forgot, I might be stupid

wide cedar
obsidian sluice
#

Soo, you are zombie now? THINKing

fallen stone
#

🙏 that's a pleasant site

hardy patio
#

@native kiln is the workshop crawler having some problems right now? Cannot finish any scan.

native kiln
#

@hardy patio having a look rn

hardy patio
#

👍

native kiln
#

@hardy patio try now

#

oh still seems to be broken gimme a min 😅

#

now it works again

#

a harddrive was nearly full and half my system put itself into read only 😄

hardy patio
#

"woops"

karmic niche
#

@native kiln I'm interested in the inner workings of your tool. (actually: what's its URL?)

Are you really doing a "backup of Steam Workshop" or is there a more efficient way of getting all files' checksums?

native kiln
karmic niche
#

Also, out of curiosity: how much space does all if it take?

native kiln
#

so what i essentially did was make a small indexer that gets a list of all available mods on the arma/dayz workshop

#

i then see whether i have the currently available version in my database

#

if thats not the case i add the mod to a queue

#

after ive determined what mods need indexing, i download them in sequence via steamcmd and first hash all files with SHA1, then run a small tool i made that gives me a json output of the files available in the pbos

#

(those contain just some basic info, filename, filepath in the pbo and sha1 hash)

#

then i wipe the db of any earlier versions of that indexed mod and put in the new data

#

so at the very beginning i essentially downloaded the entire arma 3 workshop to my server and indexed it, now im just doing the diffs

#

its 42 GB of data in the database right now

karmic niche
#

It would be interesting to see some stats that you could now generated based on what you have in your database. Like how much will all Arma 3 mods take in total, for starters. Nothing really useful, but I'm curious anyway 😃

#

Wew, I guess we're talking 1-2TB here?

native kiln
#

oh of downloaded content?`

#

let me see, should be in my servers traffic

karmic niche
#

Does that mean ~17 TB downloaded in the first month?

#

(technichally: third 😃 )

native kiln
#

hm im questioning these stats aswell but essentially yes

#

but that could add up

#

looking at this months stats so far

karmic niche
#

That's strange. I'd expect a big peak at the start and then the amount of data downloaded should have gone down, due to you fetching only mods that have changed

#

Unless it literally took you months to download all the mods

native kiln
#

i dont remember if the graph contains the initial indexing, as i moved servers at one point

karmic niche
#

And those ~17TB / month are because of your bandwidth cap

native kiln
#

ill see if its in the previous year

#

Hmm

#

well on average anywhere from 80 to 200 items require indexing at 00:00

#

so thats maybe 140 items on average per day that are downloaded and indexed

#

now i dont know how big the average mod is but given some samples id say its actually quite large

#

so the stats for one day in the last graph could very well be true, i dont know why there isnt a big spike at the very beginning though

karmic niche
#

Oh, I thought you stored that information in your DB

native kiln
#

which information?

#

oh the size

karmic niche
#

About the size of the files, sorry

native kiln
#

i believe i decided to not do it because it wasnt needed

#

however i could start putting that info into the db from now on aswell since its not much work

#

i couldnt give you exact numbers this way but atleast give you an estimated total size of all mods after a few days and a big enough sample size of average mod sizes

karmic niche
#

Yeah, that would be interesting IMO

native kiln
#

yeah let me add that now then 😄

karmic niche
#

Could also be added to the stats on your main page "keeping track of XXX TB worth of mods"

smoky halo
#

"Reuploads Found 2533 " 😠

#

How do I get it to tell me which?

glossy inlet
#

Might be a good idea to have that be expanded by default

pearl beacon
#

Someone using ShareX I see :D

#

Did I recommend you that? 🤔

glossy inlet
#

Started using it in early 2016

#

Yeah. According to the screenshot from intercept slack where you tell me to use ShareX.. It seems like you recommended that

native kiln
#

@karmic niche Saving the file size per file now aswell 👍

#

I'll get you some numbers in a few days

karmic niche
#

Cool! 😄

dusky dune
#

I'm also a unpaid sharex shill

pearl beacon
#

I am not anymore

#

because it only runs on Windows 😛

glossy inlet
pearl beacon
#

I know

glossy inlet
pearl beacon
#

.NET Core != .NET Framework though

#

and sharenix doesn't do proper oauth for imgur and the likes yet

glossy inlet
#

Someone in the comments there got it to run on linux with rather minimal changes it seems

obsidian sluice
#

Just use Shift+Win+S

#

Oh wait

nocturne basin
#

Mono and be done with it
Most of the. Net framework is Support
Though... Not sure what is required for it

fallen stone
#

Or .NET core and be done with it

vague shard
#

question on writing to file via extension in combination with mergeConfig

#

can you basically write a dummy config to file and read it with mergeConfig the moment after, and redo the cycle without hinderance?

so execute n times after another and overwrite the file again and again, and read it with mergeConfig again and again
or would/could there be issues with the file handle, or the file getting blocked or sth

glossy inlet
#

Don't see an issue with that. mergeConfig should close the file after it's done reading

vague shard
#

alright thanks

#

any thoughts on a good workflow with this:

would you want just an input field where you define the whole dummy config (class structure and parameters) you want to tweak
or
rather you provide the desired class, and a GUI would expose all parameters and allows you to tweak them (edit fields, slider, etc)

glossy inlet
#

with the second variant the user doesn't need to know what parameters exist

plush shard
#

I'm pretty much doing this just now - but I wasn't able to reuse a dummy config file multiple times (I had to Alt+Tab to close the file handle)
so now I'm just using an extension to create a temporary file with a new name every time

vague shard
#

@plush shard thanks for sharing 👍

nocturne basin
#

sharing is caring

dawn palm
#

dll update.
p3d module:
now detects a range of hidden bugs with lod properties. Duplication, control chars embedded and other nasties you won't detect no matter how much you stare at them because the are invisible to Object Builder and Eliteness
Lods: now detects duplication. yes folks, can have two identical resoluion lods baked into your p3d. Which one is used? Guess.

sly skiff
#

@dawn palm sounds brilliant!

glossy inlet
#

Guess.... Well.. That's hard. Common sense would tell you the first that appears in the mlod.
But thinking about it.. Loading the second one might overwrite the first one.

smoky halo
#

Which program do you use for sqf? I've used exclusively notepad++ with C language and realise it might not be optimal, but I've been too lazy to change.

glossy inlet
#

Currently VS Code. Previously I used Atom but you can really see how crappy it is once you get used to VS Code.
I also use n++ with syntax highlighter for quick small things

vague shard
#

SQDev or Intellij Plugin

smoky halo
#

Thanks for the quick replies! I'll check them out 😃

nocturne basin
#

some fairly random question: o2 script
what again was that used for again?

rancid relic
#

batch processing/automation of any p3d related work

nocturne basin
#

comming from literally zero experience, what is that "work" to be automated?
that is the essential part i am interested in

mostly because i consider adding O2Script support for my lil VM project

vague shard
#

mass renaming of named properties or selections

#

changing/fixing stuff in the model

#

verification of the model

#

creating overviews from model data

nocturne basin
#

🤔 so not worth the time to implement in SQF-VM i guess .. unless i want to parse the model stuff to

glossy inlet
#

you mooost likely don't want to parse the model stuff 😄

smoky halo
#

o2script is the same as sqf just different commands and datatypes

#

grammatically the same I mean here

dull parrot
#

If you do continue to use NotePad++ make sure you add sqf language support ...

dusky dune
#

@glossy inlet which sqf vscode plugin is good?

#

I noticed none of them have proper autocomplete and so

glossy inlet
dusky dune
#

hm reinstall fixed it 😃

dull parrot
#

Thanks @glossy inlet Installed VSCode and extensions

dusky dune
#

there is an Atom keymap extension if you come from that too

glossy inlet
#

VSCode will also get support for my debugger.. Once someone finishes the debugger extension for it ¯_(ツ)_/¯

dull parrot
#

Oh, cool

nocturne basin
#

Personally, I would be amused if sqfvm had proper vscode Support

dusky dune
#

sqflint does not like my macros a lot..... 😄

#

(Plus other things), got 4k errors inmy files lel

scenic canopy
#

of all the editors I've tried with arma I'd say sublime is the fastest and the one which works best with large projects

#

I can search for lod property names inside p3d files in my 30GB project without any issues

smoky halo
#

In addion to the two Dedmen has mention I used SQF Wiki, Arma Dev and Arma 3 - open last RPT. Arma Dev allows you to build PBOs and launch the client with them as well as doing hard links into the ../x/ directory structure/remove them so you can edit code while the game is open etc etc. Need to be careful with arma Dev but at the same time it can be helpful with more simple mods.

glossy inlet
#

I have SQF wiki too, but I never used it so I didn't mention it here.

nocturne basin
#

@dusky dune you can use Tools like eg sqf-vm to get rid of your macros

dusky dune
#

I don't want to get rid of my macros :3

smoky halo
#

Yeah well you know it inside and out, it is for mere mortals 😃

nocturne basin
#

But then you can lint 🤔 though... The moment you would put in the work to do that, you also could just use sqf-vm for everything

smoky halo
#

I know too many languages and too many APIs, I don't remember the details every time anymore.

#

Open last RPT didn't work in the previous version of VSCode but it is working with todays update, so that is nice 😃

nocturne basin
#

🤔 the visual studio code debugger extension stuff is not looking that complicated actually

#

just need to figure out what a lot of this is doing, and then i may even be able to write an extension for sqfvm

nocturne basin
#

and most importantly: how to get a bloody TCP server running

dusky dune
#

might look into 'fixing' syntax highlighting for VS code, at least so i can get my good old monokai the way i like it

#

honestly the reason i stick with Atom for SQF, although i switched to vs code for just about everything else 😄

pearl beacon
#

Which sqflint? LordGolias' works very nicely for ACE3

dusky dune
#

the vscode plugin one, uses that one i believe but it struggles with my module setup (Thinks all the functions are 'core' module, rather than the one they are in). Lots of other errors as well, like right now i got about 7k errors 😄

#

undefined functions (using my own function compiler, neither ACE nor cfgFunctions). Undefined vars (Due to some hacky stuff with my file reading.

smoky halo
#

It produces errors with CBA log statements, struggles with macros in general that I could see.

karmic niche
#

The last time I checked LordGolias' commandline program with Frontline source code, I got a few crashes/exceptions. That was a few months back, though

glossy inlet
#

"I got crashes and exceptions!" Meanwhile in the github repo: Open Issues: 0.
"This stuffz broken!" Open issues: 5. But none of themare about the broken stuff

#

Yeah vscode debugger extensions are like really easy to make. But I'm too dumb to run skaceKamen's one in debug mode

karmic niche
#

Was going to make it work with Frontline and then report the bugs, but when I realized that due to our macros it's not gonna work anyway, I ditched the idea.
FYI: I'm not bashing his software. Just stating the fact that for me it definitely wasn't works very nicely

glossy inlet
#

But LordGolias' thing supports macros afaik? Or does it still not?

dusky dune
#

it does, but struggles every now and then. I might take more of a look tonigght and see if anything is easily reportable 😄

neon flax
#

VSCode plugin from SkaceKamen works really well if you're using CfgFunctions.

#

It parses function headers (cba or bis format) so you can see your function params in autocomplete.

#

Also supports right click on func > go to definition.

dusky dune
#

(alt click)

nocturne basin
#

by any chance, did somebody ever implemented a debugger extension for VSCode?

glossy inlet
#

implement*

#

yes SkaceKamen implemented 80% of one for SQF

nocturne basin
#

also have the example project
it is fairly useless to me unless somebody can explain to me how in the bloody fucking world one gets something like a simple interface for the whole crapload of shit

though ... if i understood that whole documentation page correctly, i also could just use any other language and parse stdin and stdout directly ...

#

however
it is fairly unclear how to do that proper

#

at least to me 🤷

fallen stone
#

or you could create a language server 😃

nocturne basin
#

do not get me started on that one ... implementing the debugger is already a challenge

#

even though, i could do that (implementing the language server stuff), the actual work required is way too much

#

thing is in the end: no ready-to-use solution available

#

thus no language server

#

though ... when i would do that, it probably would be the best SQF-Lint plugin in the world

fallen stone
#

no ready to use solution?

nocturne basin
#

because i got best software in world

#

will build a wall around my software empire

#

to keep all the lazy bugs outside

#

@fallen stone yup
c++ language server i just can stick into sqfvm and it works out of the box with me just doing some random interfacing
highly doubt there is something like that ready for me to be picked up

#

all would require stripping the existing stuff out of it and putting it back in

#

merging it with my current infrastructure etc.

#

and even though i am up for a good challenge, i am not insane

#

and there is no task in programming more dull then implementing other peoples protocols

nocturne basin
#

Just figured out how to do 3d stuff in wpf c#
Does somebody has a need for some tooling utilizing 3d?

sly skiff
#

What kind of 3D?

#

Models related, terrain related, both?

#

Could always use a more stable and uncrashing tool to replace Terrain Processor

nocturne basin
#

I think Terrain builder might be a lil bit too much for wpf 🤔
But would need to confirm

#

Pretty much everything that has vertex data and indexies

sly skiff
#

Not builder, but the processor

#

It uses the height map and shape files to generate object placement.

nocturne basin
#

Mhh? Never worked with that stuff

sly skiff
#

a new challenge 😄

#

the BI provided tool is unfortunately broken right now.

glossy inlet
scenic canopy
glossy inlet
#

Don't know what I would add to there it's already purrfect. I'm using the Core library from that

scenic canopy
#

ah, I thought you had your own parser based on the class names in the debugger. I guess it's just another model pingturtle

dull axle
#

Wow, didn't knew there was a .net library for BI files. Great link!

glossy inlet
#

Okey yeah I will probably have to make PR's to T_D's library. It's missing some weird modified LZO compression stuff... I have a hacky workaround for now but I need to investigate that properly before PR'ing.

Man my performance is utter garbage 😄
50% of the time is spent in T_D's LZO decompression code.. Although LZO is supposed to be ultra fast 🤔

smoky halo
#

LZO code is pretty battletested...whenever I had LZO errors it was because something else was wrong ^^

glossy inlet
#

The LZO code itself is not incorrect.
Binary arrays have some special flag to indicate that they should always be LZO decompressed/compressed even when size is <1024
Your code doesn't check that flag and tries to load the LZO compressed stuff as plain

#

Throwing multithreading into the mix makes it quite a bit faster..
Probably not the best idea to run this through dokanpbo 😄

There is a byte flag after the size of the binary array. And if that flag is 2 it means it's lzo compressed even if too small

smoky halo
#

i have code for that...

#

its part of the BinaryReader

glossy inlet
#

You have the UseCompressionFlag. But the number is 2. So ReadBoolean seems a little wrong there
Also only 2 is the special flag for forcing compression. I've also seen 3 I think.
I'm using the BinaryReader.

smoky halo
#

LZO class just handles that lzo...not flags that define using lzo ^^

#

ah, that is what you talk about.

#

would need to check if it is perfectly correct there, but as I said: battletested ^^

glossy inlet
#

I added code now to read the flag byte manually and force LZO decompression if the flag==2.
I'm running it on P-drive and am at model 700 now without errors. So that's looking good

smoky halo
#

you had errors before?

glossy inlet
#

Well your readCompressedIntArray tried to read as uncompressed.
And enabling the compression boolean flag that you have there also caused reads at wrong offsets when I tried that

#

Might try around more tomorrow

smoky halo
#

hmm...

scenic canopy
#

I need to finish my derapify and paa->png in JS 🙈

#

maybe I should try wasm with armake or dedman's cpp fork

novel wraith
#

Alright, coming around here to ask this but what usually causes this error in Tools Publisher?

#

Steam error code: 2, Steam error message: Fail - generic failure

sly skiff
#

there may be answers here

novel wraith
#

Looks like it may be related to like a version mismatch? Which makes sense... I'm actually publishing off of a crappier laptop that I don't use that much (issues with the main desktop for now) and doesn't have the most up-to-date version of the game on it. Thought I could just swing it but I'll update everything and see how it goes for fixing it

novel wraith
#

Looks like that didn’t do much

glossy inlet
#

I've seen that error before from others. Don't know about a fix. It's on Steam side

vague shard
#

for those interested how one can tweak game (terrain) shaders

karmic niche
#

"and especially kju" - now we know why this link has been posted 😄

scenic canopy
#

supernice!!

#

will we see these enhancements for CUP as well? 😉

pearl beacon
#

haze removal and improved color grading is nice, but everything looks a lot more pixelated in the final ANZINS version screenshot, like too much sharpness

orchid shadow
#

Tried it ingame and it was nice.

#

Think i'l play with it and see how it is.

#

Most noteable from the area because the ground dosent look like a spotted cow

rancid relic
#

has anyone else issues with this mod and tanoa?

#

for me mid range textures appear after like 10 seconds

#

other than that, it's so different that it's hard to tell whether I like it or not - I just got used to current look of Altis, ha

vague shard
#

@rancid relic tanoa is not yet configured

#

one can configure it per surface to quite some extent

#

defunkt will provide docu in the coming days

sly skiff
#

Interesting to see what can be done with it.

orchid shadow
#

@vague shard what maps are configured?

#

I tried it on Rosche and it looked quite nice.

vague shard
#

Stratis, Altis and Malden - and terrains inheriting from them (cfgWorlds)

#

the cfgSurfaces from these as well. but i think most terrains have their own

#

i will ask Defunkt to come by here. he is just taking a short break as the shader work was quite challenging

hardy patio
vague shard
#

@hardy patio the coloring means the shader does not work. what GPU do you have?

hardy patio
#

nvidia 1070

#

do i have to move the optional pbos from the dta folder as well?

vague shard
#

not necessarily. can you send your rpt with such session via DM please

hardy patio
#

hang on lemme enable logs

vague shard
amber heart
#

Hi all, If you're seeing rainbows in the terrain then the revised shader is not loaded (from mod dta\bin.pbo). I've only configured it for Altis/Stratis/Malden so far. Terrains that inherit from these and don't explicitly set TerrainBlendMaxBrightenCoef may inherit the change and will probably not look all that good (for best results it needs to be tuned for the terrain).

#

It can be disabled for any terrain that has inadvertently inherited the enable value by making a small patch that sets TerrainBlendMaxBrightenCoef (to anything less than 1.00, usually 0.15).

pearl beacon
#

Thanks @vague shard

wide cedar
sick verge
#

Does somebody in here know why

#define MACRO(A part)
MACRO(Something)

results in (after preprocessing)

\n
)```
The `\n` is used to represent a newline in order to prevent Discord from discarding it.

So the macro definition clearly is erroneous but why does it print out a `)`?
#

The same thing applies to

#define MACRO() bla
MACRO(Hello)

which also preprocesses to

\n
)

On the other hand

#define MACRO(One Argument) Here is One Argument
MACRO
MACRO(Me)
MACRO(Me You)

preprocesses to

\n
\n
\n
)```
which kinda breaks the theory that invalid macro definitions always lead to a `)` when using them...
smoky halo
#

is this dicord macro?

#

or C?

vague shard
#

@dawn palm ^

sick verge
#

SQF

#

Or rather Arma-Preprocessor macro @smoky halo

smoky halo
#

and no error?

#

lemmie try

sick verge
#

Actually I'm not sure whether I got an error (tested it a while ago) - but I think not. But the preprocessing was done anyways yielding above results

smoky halo
#

if there is no error that is one thing

sick verge
#

I would try it out again myself but Steam decided that I have to do a 1.4GB Arma-update...

smoky halo
#

well it looks like if it cannot match macro, which it can never match because argument never match, it replaces every MACRO with nothing, since you defined MACRO The last ) is just subpar parsing

#

Should have checked for validity of macro TBH

sick verge
#

What is subpar parsing? 🙈

smoky halo
#

it is when you put a finger up the ass and with another finger start typing c++ code

glossy inlet
#

the opposite of abovepar parsing

sick verge
#

I don't know that either...

glossy inlet
#

subpar == ungenügend/schlecht

sick verge
#

💡

#

thx

smoky halo
#

someone should make request for BI to officially release pre-processor code, trying to guess how to break it so that it works like in game is just 💩

sick verge
#

Agreed

#

Okay so I just did some further testing and it appears as if the following rule applies:
If a macro is defined improperly (in any of the above ways) all usages to it will result in an empty output. If the macro-call is followed by an EOF the mysterious ) is being inserted

glossy inlet
#

maybe something like "this is invalid, just skip it and print the next character after this instead" "Oh crap.. EOF.. Then use the last character before EOF I guess"

smoky halo
#

yeap shitty parsing

sick verge
#

It's even worse

#
#define MACRO(A) This is A
MACRO```
results in

\n
MACRO```

glossy inlet
#

why worse?

#

that's correct

#

MACRO doesn't match any definitions

sick verge
#

🤦

#

Right

glossy inlet
#

I wonder what
#define MACRO() stuff Do you need to use it like a macro with 0 arguments aka empty parenthesis? 😄

sick verge
#

I'll have an answer in a sec...

#

Yep you can use it with empty parenthesis

glossy inlet
#

anticlimactic

smoky halo
#

valid macro

nocturne basin
#

@sick verge arma preproc is broken beyond repair for ages now 🤷 just mark it as broken and the user will be happy

sick verge
#

I'll mark it as broken anyways - I just want to reproduce the preprocessed content as good as possible

nocturne basin
#

yes
but theese are those cases, where you either have to use the original PP or you need to intentionally magically create bugs in the same way the BI PP is bugged

sick verge
#

Well this bug can be easily included with a switch whether or not you actually want to reproduce it

karmic niche
#

Not sure what you're trying to achieve eventually, Raven, but in this case, I'd go with Mikero's route by creating a tool that works the way it should (instead of reproducing the original bugs)
Letting people rely on bugs for their code is bad for them, in the long run.

nocturne basin
#

Need to test now what swfvm does then
Not sure actually 🤔 could segfault at worst, throw errors at you in best case

smoky halo
#

swfvm? shock wave flash virtual machine?

nocturne basin
#

Sqf-vm @smoky halo mobile phone..

dawn palm
#

since my tools won't let binarise get anywhere near any form of param file, it's of no consequence to me, or you, if bis don't do it properly, can't, or (as usual), won't fix it.

#

their preprocessor gets it majorly wrong with array[] macros, and of course, totally wrong with the array+= operator

cinder meteor
#

I wonder what #define MACRO() stuff Do you need to use it like a macro with 0 arguments aka empty parenthesis?
Coming in defense of macro like #define MACRO() stuff a day late... they use it in C to make it appear like a proper function, although we are in SQF and not in C now
http://gcc.gnu.org/onlinedocs/cpp/Function-like-Macros.html
I use it in my stuff sometimes like #define MY_STRUCT_NEW() [0, 0, 0, player] to create structures with default values, for instance.

glossy inlet
vague shard
#

awesome 😃

#

dont forget about the case check. i suspect 3rd party tool modification could lead to not lowercase only

glossy inlet
#

Oops yeah. I actually thought about that when I wrote the IsEnum.. But then I forgot again 😄

glossy inlet
#
            {
                "shadow",
                new List<PropertyCondition>
                {
                    new PropVerify_IsNotEmpty(),
                    new PropVerify_IsOnGeoLod(),
                    new PropVerify_ExpectPropertyNotExist("sbsource"),
                    new PropVerify_IsEnum(
                        new HashSet<string> 
                        {
                            "hybrid"
                        })
                }
            },

I love this.
Although I hate the amount of indentation 😄
But it's so easy to understand

native kiln
#

I will need to make all your method names start with capital letters once you're done

glossy inlet
#

Yeah there is lots of stuff to be made more nice. I don't see that sharp.

native kiln
glossy inlet
#

Implemented the rest of the verifiers that we have so far.

glossy inlet
vague shard
#

@glossy inlet do you plan "only" information/overview with the tool, or is the goal is also modification (automatic or manual)?

smoky halo
#

GUI yay!

glossy inlet
#

Modification too. Quick fix style too.
You are listed as contributor btw, you can contribute all you want 😄

dusky dune
#

@glossy inlet does that work for binned ones?

glossy inlet
#

yeah

dusky dune
#

I'm looking for a way with my object placement mod, to properly detect landSlopeContact on the fly, instead of needing to package in pregenerated template files

glossy inlet
#

Well needs extension then

dusky dune
#

i'm using pythia (stacks python mod)

#

Also was looking into making proper template files without TB all together

#

Right now I'm missing the autocenter / bbRadius type stuff though, which TB does detect when generating template files

#

(TB doesn't detect landSlopeContact when generating files)

scenic canopy
#

There’s a tool on my GitHub that can validate if all items in an import file exists in the template files, if that’s of any interest

dusky dune
#

nah, using the actual template files as the library within the mod

#

it loads the .tml files ingame

scenic canopy
#

Ah, cool

#

You could export the geo data from ingame if you want

dusky dune
#

yea was thinking about something like that, unfortunately still no access to landSlapeContact ingame

#

can't detect it with any of the sqf stuff 😄

scenic canopy
#

Or dig into the p3d

dusky dune
#

yeah, dunno how to do that 😄

glossy inlet
#

The C# code for reading the p3d is there

#

I could probably jury rig some intercept thing together to read properties

dusky dune
#

mainly just looking into dayz type stuff right now though, prepare object placement mod for enscript stuff, so first steps is learning the language.... 😄

vague shard
#

how hard is a sqf command to read out named properties, and how useful?

glossy inlet
#

Well if you have author properties you can read them.
Hard... Uh... 20 minutes of work.

limber garden
#

Could Intercept be capable of changing a model's scale? As far as I'm aware, that's something you can currently only change in TB

glossy inlet
#

ough. Probably not

limber garden
#

I'm sure @dusky dune would love it for his object placement mod 😛

dusky dune
#

i would, did request something similar with kju 😄

#
object scale command

A command in SQF that allows you to set scale to an object, _object setScale 0.8 Terrains have scaled objects so there must be som```
#

etc

#

What about a isTerrainObject command?

#

right now i do a check on the objects position with nearestTerrainObjects and check if it's the same object 😄

#

also a getScale command.... which right now I do by creating an object of the same model, then doing a boundingbox size comparison 😄

limber garden
#

According to the wiki the scale is defined in the TransformMatrix for the object in the WRP, which also contains the x, y, z position, and orientation

dusky dune
#
/*
    Function:       ADA_Core_fnc_getObjectScale
    Author:         Adanteh
    Description:    Gets the scale of current terrain object
*/
#include "macros.hpp"
#define __TESTPOS [-2500, -2500, 2500]

params [["_object", objNull]];
if (isNull _object) exitWith { 1 };

private _corners = (boundingBoxReal _object);
private _distanceObject = (_object modelToWorld (_corners select 0)) distance (_object modelToWorld (_corners select 1));

private _objectModelPath = (getModelInfo _object) select 1;
private _testObject = createSimpleObject [_objectModelPath, __TESTPOS];
private _corners = (boundingBoxReal _testObject);
private _distanceReal = (_testObject modelToWorld (_corners select 0)) distance (_testObject modelToWorld (_corners select 1));

// -- This value could be cached with _objectModelPath if you want, seeing it won't change
deleteVehicle _testObject;

(_distanceObject / _distanceReal)

such code much wow

#

probably 90% of my 'weird' functions could be done in intercept..... if I wasn't a brainlet and knew how to do it 😄

nocturne basin
#

i highly doubt that

glossy inlet
#

everything you do with SQF can be done with Intercept. Sooo.. Yes.

plush shard
glossy inlet
#

@dusky dune your _distanceReal modelToWorld doesn't make sense

#

you already have both corners. Just take the distance between them. Whether in model or in world coordinates doesn't make a difference

plush shard
#

vectorDistanceshould be slightly faster / more exact for vectors

amber heart
#

@glossy inlet Regarding Intercept, what would be a classic use case for interacting with the game via this wrapper? Running complex calculations (smarter AI springs to mind) on a parallel thread seems like the obvious one - but what other advantages?

#

Also, does it export functions that could be called from a higher-level language?

nocturne basin
#

the main pro argument is custom commands for SQF

#

if you would ask me

#

(and with em custom data types)

#

the rest is just: everything is faster then SQF

glossy inlet
#

@amber heart You can make custom commands for SQF to do things more efficiently/faster. You can do math heavy calculations in a seperate thread (you cannot call SQF commands parallel to the game)
Intercept itself exports only C interface, you have to make your own exports if you want to call it from something else.
Other advantages are that you can use everything that C++ can provide you, plus the ability to call it directly from SQF using native types. Instead of going via callExtension and having to serialize/deserialize everything

amber heart
#

@nocturne basin, @glossy inlet Thanks both, sounds like magic. So you can actually create new SQF commands and execute them from the game without using CallExtension? Although it's not really my wheelhouse I'm somewhat intrigued by the idea of trying to make the AI better at CQB using a parallel thread to do continuous path-finding and LOS-checks, then an in-game script periodically checks-in and asks; what's the best thing this unit could be doing now? Could Intercept directly access information about entities and their state/location or would such an in-game script have to feed this information explicitly?

glossy inlet
#

path-finding and LOS-checks Well you can't really

#

As I said. Can't call SQF commands from seperate thread

#

Intercept has a special thing to get a objects transformation. But that's the only thing really. And I don't know if it currently even works

#

Or atleast. Intercept won't help you with doing that. You have the world of C++ at your disposal so you could do lots of things sure. Everything is technically possible

amber heart
#

No (call from parallel thread) but if the worker thread was simply updating a table of prioritized 'go here (and do this) next' outcomes an in-game script could request those results from the main thread as time allowed?

glossy inlet
#

Well as long as you can do it without getting any information about the actual game world in the seperate thread.. sure.
But I think you'd need that if you want to find possible locations where AI could go

glossy inlet
#

I think the Model Property Checker just found it's first real error. "lodnoshadow=1" on "ShadowVolume 0" doesn't reallly make sense...

vague shard
#

well lots of NP dont make sense in A3 (or mods) data 😄

glossy inlet
vague shard
#

@glossy inlet hide is the default map value though 😛

glossy inlet
#

Yeah I didn't fully implement the enum values yet kinda waiting for your spreadsheet to be completed 😄

vague shard
#

what missing? (besides adding the two NP)

#

like i still want to make the common templates for vegetation (bushes, trees, etc), vehicles, weapons, characters, buildings, objects

glossy inlet
#

Wow. A file in ace with like 18 undefined properties. All properties copy pasted over all non-res lods :D

Dunno. Did you already go through all map/class types from my screenshots or whatnot and enter that in the list? I didn't

vague shard
#

i did integrate what you provided into the wiki page

#

the sheet was meant as reference from BI models - not to portray the complete set. should it?

glossy inlet
#

oh. Doesn't need to I guess

glossy inlet
#

Ugh property patching will be a chore. MLOD is relatively easy. But for ODOL if the length changes I need to update everything after the properties. And also some stuff before them

nocturne basin
#

only provide a "Patch All" button for ODOL stuff
collect all changes and do it in one go instead of doing it for each

vague shard
#

@glossy inlet could ask mikero how he does ODOL updating with DeP3d

nocturne basin
#

as alternative, write your own Stream implementation where you can use Insert
as base, a List<byte> could be enough

#

and when all changes are done, just write it out

#

or no ... wait ... requires your own list implementation too

#

a mixed linked and unlinked list technically

#

can get quite complicated but managable

glossy inlet
#

Well I already know how it has to be done

#

I don't think mikero does it any different

vague shard
#

@glossy inlet our models crash it 😬 does it write a log somewhere?

glossy inlet
#

nope. MLOD or ODOL?

#

Would need to run in debugger to find out where the model parsing fails

#

I'll run it on a p-drive now. Maybe I find some causes in there

vague shard
#

both

#

i can run on subset (assets vs objects, or MLOD vs ODOL)

glossy inlet
#

MLOD parser should be good I think 🤔
ODOL is missing some things

glossy inlet
#

Okey just 10x'ed the model loading speed 😄

vague shard
#

MLOD crashes too. some logging in next version would be good to see whats up

glossy inlet
#

Don't know if I can catch all exceptions and throw a message box

#

BI really likes putting lodnoshadow into lod's that aren't considered for shadow anyway

#

Ah yes. That seems to work

#

Should print message box with filename and stacktrace

#

Would be best if you can catch it failing on a ODOL that you can send me so that I can reproduce

glossy inlet
nocturne basin
#

@vague shard check Event log of Windows
The crash reason should be inside @glossy inlet best you zip the exe with the pdb so you get better info
Also can Show you how to catch All exceptions

glossy inlet
#

We solved the problem 3 hours ago

#

Fixed crashes related to duplicate properties

nocturne basin
#

does not matters if it is solved now

#

it is to fix future issues

glossy inlet
#

Already added exception logging to console.

nocturne basin
#

kk

smoky halo
#

how do you catch all exceptions?

glossy inlet
#
catch (Exception ex)
{}
smoky halo
#

I thought 39 knows some neat trick like a flag or something. Yeah I can wrap code in try. Also catch (...)

nocturne basin
#

depends on what and where @smoky halo

#

a global try catch however, is not the right solution 😄

#

most of the time, it is enough to add a DispatcherUnhandledException handler to your App.xaml for WPF

glossy inlet
#

Last build today.
Shows percentage of completion.
Ability to export all issues to a file.
Fixed crash on something something model sections something 🤷

Have fun testing. Please don't find too many issues.

drowsy comet
#

Its really helpful thanks

scenic canopy
#

@glossy inlet will there be a CLI version too?

glossy inlet
#

uhhhh... Not.. planned... Would I need to compile a seperate binary for that? Or can I just not create the UI based on a start parameter?

#

I mean.. It's not hard to do.
What would you want it to do? print to text file? Or to console output? and in what format?

scenic canopy
#

CI

#

Console is fine

#

Make sure to set exit code if any file is broken

scenic canopy
#

Or at least have the option to fail with exit code

nocturne basin
#

Ci host still would require Desktop though

nocturne basin
#

with a new base of ArmA.Studio that will be more clean then the old one (plus it features literally no features currently)

#

it may not look impressive yet, but that literally is just a drag n drop demo

scenic canopy
#

😄

#

I got PBO browsing working in the browser at least

#

just need to write that derapifier and paa->png 😦

dusky dune
#

@nocturne basin you looked at the enfusion UI editor in the workbench?

#

Also how is that sqf>enscript parser coming along (hehehehehehehe)

nocturne basin
#

@dusky dune not really looked into that one

SQF > enscript requires enscript to be fully available for arma itself and me to Start using enscript

dusky dune
#

If you have dayz, you should give it the UI editor a spin, it's pretty good

nocturne basin
#

Will see

#

Main thing in the end is getting arma Studio base clean

karmic niche
#

Can I submit an issue that you're spelling Arma wrong in your ArmA-Studio name? :/ @nocturne basin
(Yes, I'm serious and it annoys me when people call Arma ArmA years after the devs said they hate the latter name)

nocturne basin
#

@karmic niche it is named like that for years now

pearl beacon
#

and it's still wrong 😄

nocturne basin
#

Will see
Maybe I will Update it 🤷‍♂️

#

But requires renaming a lot of stuff

sick verge
#

Does somebody know what the Arma-preprocessor does when defining a macro that has been defined already? Will it overwrite the previous one, ignore it or error on it?

glossy inlet
#

overwrite

sick verge
#

Thx

glossy inlet
#

But some custom preprocs throw warnings or plainly error out completely

sick verge
#

Well I am only interested in what Arma does... I'll issue a warning when overwriting macro though 🤷

smoky halo
#

Yes you need to #undef but not in Arma 😫

sick verge
#

So basically the #undef is only needed if one wants to influence the behavior of a #ifdef or #ifndef block?

glossy inlet
#

Yeah

#

Btw you cannot nest #ifdef's in arma

sick verge
#

Okay
Yeah that I know

#

Though I'm not sure whether I implemented that restriction into my version of the preprocessor ^^

#

Added the respective error message - though it still processes nested ifs as one would expect cause I don't want to add a special case that allows not processing those xD

nocturne basin
#

@sick verge either you do care about what arma does or you do not
and as a matter of fact: IIRC, you create a IDE and no packaging tool 🤔

sick verge
#

@nocturne basin i try to give the option to reproduce the arma behavior wherever this can be achieved with little effort. This time it is not the case.
And yes I am writing this for use in an IDE but this is an independent piece of software so I want it to be reliable for other use cases as well. Furthermore the whole packaging is intended to become a feature in SQDev at some point...

nocturne basin
#

uhm .. why is this a huge effort to just allow a single ifdef?

#

it literally breaks the whole file when you nest one

sick verge
#

Because of the way if-blocks are processed in my implementation. Besides the preprocessor does error on nested ifs. But if you let it continue it will handle then nonetheless. No harm done I'd say 🤷

nocturne basin
#

you should not allow continuation

#

you either follow arma or you say "meh fuck it"

sick verge
#

What would be the better alternative? Crash the whole program. Doesn't seem senseful to me...
If someone is being bothered too much by it I am more than happy to accept pull requests with the implementation

nocturne basin
#

Error out
Never said anything about crashing @sick verge

smoky halo
#

nuke it from the orbit, the only way to be sure

cinder meteor
#

Maybe there is a way to just call arma's built in preprocessor and return compiled text for Raven's plugin? Maybe through Intercept?

nocturne basin
#

@cinder meteor there are multiple ways noeadaxs

sick verge
#

I have almost completed m preprocessor anyways so there's no point in starting to use something else now

glossy inlet
#

Maybe through Intercept? Yes... But that would require you to like.. always have Arma open.
Not an option IMO

sick verge
#

Yep

nocturne basin
#

Maybe though sqf-vm (shameless self advertising)

glossy inlet
#

Yeah. Can just use sqf-vm preproc. Or armake preproc. or armake2 preproc. or whatever other preprocs are already out there. But accessing that from java.. ugh

nocturne basin
#

Fairly straight forward tbh @glossy inlet

meager falcon
#

jni

#

Or however it was called

scenic canopy
#

only supported by ToH

#

oh, sorry

#

I was thinking about the java sdk

#

JNI could be used

#

or just spawning a sqf-vm process

nocturne basin
#

Debugging api 😉

pearl beacon
#

I have updated JNI for x64 if anyone wants it, not sure if original was ever updated

#

no license on original repo so I am not sure I can even put it up though 😛

nocturne basin
dusky dune
#

big focus should probably be on ctrlgroups btw, they're a lot better in arma and it's the main thing that helps you create decentish UIs

#

cool work though

nocturne basin
#

that part actually is related to work obviously (and not the UI editor :D)
but the actual UI editor part of my ArmA.Studio rewrite also works that way 🤷

#

tbh ... never worked with control groups

#

which is probably quite problematic when i want to create an editor that uses em

#

though ... got ideas how to implement them

nocturne basin
karmic niche
#

:+1:

dusky dune
#

PLS GIVE EMBED RIGHTS ;_;

nocturne basin
#

Mhh?

dusky dune
#

Arma
ArmA

nocturne basin
#

Oh.. Feel free to PR

dusky dune
#

UNACCEPTABLEEEEEEEEEEEEEEEEEEEE

#

also all the folder names :3

nocturne basin
#

The actual change only is in Remake branch

cinder meteor
#

So... did you decide to finish Arma studio?

nocturne basin
#

@cinder meteor it actually Was kinda finished 🤷‍♂️ but no interest so no further development

#

You can Download it now and could use it perfectly fine

cinder meteor
#

IIRC there were problems with debugger breakpoints caused by BI's changes... which would be the most huge benefit for it IMO

nocturne basin
#

Debugger was actually the problem

#

And nobody used it anyway so @glossy inlet never patched it

#

Could provide a new Front end and it would be working again though 🤷‍♂️

cinder meteor
#

I think i was told that BI deleted something in the engine so it won't work anymore anyway?

glossy inlet
#

BI broke the debugger

nocturne basin
#

The latest of him is working again iirc

glossy inlet
#

And when I fixed it Arma.Studio already went off the stage

nocturne basin
#

It is still
Maintained

#

Just ot devleoped

glossy inlet
#

A few parts of the protocol changed slightly. Not much work to fix

cinder meteor
#

wait, so you mean that the debugger CAN make breakpoints?

glossy inlet
#

sure yeh

cinder meteor
#

😮

glossy inlet
#

Just there is no client that's publicly available right now that is compatible with the latest API of the debugger

cinder meteor
#

Oh so that's the GUI integration problem, I get it

glossy inlet
#

There is a VS Code Extension that's like 60% working. The basics are implemented. But I am too dumb to complete it.

cinder meteor
#

Is the API to control the debugger very hard to use?

nocturne basin
#

Well... Then fixing the arma.studio frontend should not be hard

#

Can Look into it back home

cinder meteor
#

Well, I wish I were better at C++, really want to have breakpoints for arma 🙄

nocturne basin
#

C#

#

Arma.studio is c#

cinder meteor
#

Oh I can't C#, damn

nocturne basin
#

Actually... C# is way simpler

cinder meteor
#

Last time I made a C++ program for Windows I made my whole PC freeze so many times before I understood how to draw inside a window :D
Maybe I can have a look at Arma studio then

glossy inlet
#

The VSCode plugin is javascript

pearl beacon
#

C++ for drawing stuff alone, bad idea, use Qt at least or something 😛

nocturne basin
#

sooo ... arma.studio has the debugger potentially fixed, only thing required now is testing it with some arma installation + debugger

swift apex
#

what would be the reason for binarize crashing in pboproject?

#

I'm trying to pack a .p3d folder but its giving me a binarise crash

vague shard
#

check the logs

vague shard
#

anyone here good in c++ code crazy enough helping me decode the BI clutter placement algorithm - if so, PM please

nocturne basin
#

Chances are, it is just some noise function @vague shard

vague shard
#

nope. as far as i can tell its not

#

the core placement algorithm i have already

#

the two open parts are:

  1. taking in the terrain parameters (from config and wrp)
  2. transforming the random algorithms used to something similar in sqf for now at least
swift apex
#

@vague shard where would i check the logs/

#

?

vague shard
#

pboproject - open logs

swift apex
#

all it says is binarise crashed

vague shard
#

both?

glossy inlet
sick verge
#

Oh well 🤷
We really need a wiki page listing all available tools so one can quickly check if there is an existing implementation or not.
But thanks for the hint @glossy inlet

nocturne basin
#

theoretically, there kind of is

#

but practically, it is not named "community tools"

sick verge
#

Where? 🤔

nocturne basin
sick verge
dawn palm
#

FREE TOOLS UPDATE for xmas 😍

A snapshot of the latest subscriber release is now available for you all to enjoy. God knows how many fixes, improvements and updates have been made. too many to list. However.

+the free tools are now fully dayz compatible
+no more warnings about unknown mapinfo items.

Enjoy.
https://mikero.bytex.digital/downloads

orchid shadow
#

👍

sour hedge
#

Is Mikero's website link down for anyone else at the moment? "This site can't be reached / took too long to respond".

lavish cypress
#

same here

sour hedge
#

@dawn palm Thanks for announcing a tools update and happy new year. The link seems to be broken at present.

fallen stone
#

that's the one 👍

vague shard
#

it seems there was a workshop agreement update recently
as long as you dont agree to the latest version, the links to your workshop items no longer work
is this a known problem/any chance for Valve to fix that?

pearl beacon
#

nothing to fix; either you agree or not have your item available on workshop anymore

#

it's not the first time

vague shard
#

well for users its pretty confusing to see a N/A page instead a proper info page

#

plus the content is still available if you go by search and navigate steam itself

#

so its a design flaw to make links broken and not even bother to put up proper information

pearl beacon
#

sure, but they did it, they won't fix it

#

because they don't consider something to be broken

karmic niche
#

Mikero, what about the Maverick page? Any reason you're not advertising that one? Is it going away or are you going to release stuff on both services? (I'm just curious)

#

(oh, I just noticed that clicking on the "free downloads" or "purchase now" there redirects to bytex.digital)

glossy inlet
#

MIkeros page says that the maverick page is "the old distribution page"

fallen stone
#

New website

native kiln
#

The old free filebrowser link now links to the new one

glossy inlet
dawn palm
#

k

#

hmm, i think it does, it is otherwise seen as a file\reference\

glossy inlet
#

macro names cannot be file references

#

and \ is not a name character

dawn palm
#

that' true, but sth is bugging me about BLAH\

#

will have to do some research.....

#

ah yes,, got it.
#define BLAH
hello world

causes catenation to

#define BLAHhello world

the space is required

glossy inlet
#

Should concat to #define BLAH\nhello world I think?

dawn palm
#

newlines are not separators

glossy inlet
#

\ stops the macro from ending at line break.

#

But keeps the line break

#

macro name ends at any non-name character. A-Z_0-9 I think

dawn palm
#

yes to non-name char, but \ takes precedence in the preprocessor to be invsible to the define

#

the result is catentation of the next line without space separation (because there aren't any)

glossy inlet
#

yes it is.. But as I said.
That results in #define BLAH\nhello world
And macro name ends at first non-name character. Thus
key: BLAH
value: \nhello world

#

Just tested ingame

#define BLAH\
hello world


1
BLAH
2

-> preprocessFile ->

"



1
BLAH
2"

the newline disappears because Arma trims the resulting string after resolving the macro

dawn palm
#

all chars, including crlf are stripped immediately and the nextline begins where the \ was

#

what bis do, is up to them.

glossy inlet
#

Well that macro is correct in Arma itself (just tested it) and it was correct before. And it is correct in other preprocessors.
It doesn't work with your latest release.

dawn palm
#

ok, will check again.

#

tested it on visual stdio. it catenates. What bis get wrong is up to them.

#

#defjne THIINGY
(space)hello
is fine

#define THINGY (space)
is fine

#define THINGY
hello

is not

pearl beacon
#

Arma does not use C++ preprocessor

#

why do you want to force some unrelated thing upon Arma config

sick verge
#

What bis get wrong is up to them.
Well that's how the game works so it doesn't really makes sense to deny it 🤷

pearl beacon
#

BI got nothing wrong, that's how they designed it and that's how it is

dawn palm
#

for the same reason Jonpas the bis preprocessor makes a mess of arrays

pearl beacon
#

your tools handled it just fine, now they don't, latest tools update is not backwards compatible and forces projects to fix something that was never broken and works just fine in Arma

glossy inlet
#

The preprocessor behaving different than the C++ preprocessor is like saying SQF behaves different than lua.
It's a different thing, so it behaving differently is not an error

dawn palm
#

it's broken in several places, not, just 'different', broken

vague shard
#

  int seed = 1000;

const float RandInvDivider32767 = 1.0f/32767.0f;

    // fast hash function
    int val = (seed ^ 61) ^ (seed >> 16);
    val = val + (val << 3);
    val = val ^ (val >> 4);
    val = val * 0x27d4eb2d;
    val = val ^ (val >> 15);
    name = (val&0x7fff)*RandInvDivider32767;```
pearl beacon
#

ok so how was it broken exactly?

vague shard
#

what does this do and what is a meaningful input for seed?

glossy inlet
#

this does some bitshifting and math 😄

pearl beacon
#

hashing 😛

vague shard
#

yeah so much is clear

dawn palm
#

+#ifdef followed by ifndef
+completely broken arrays

vague shard
#

BI what does it actually do

pearl beacon
#

can we stay on topic mikero?

glossy inlet
#
#define THINGY\
hello

is not

Just tested in Visual studio c++ project. Works fine.
No errors.

vague shard
#

the result should be between 0-1

glossy inlet
#

@vague shard just google for 0x27d4eb2d and read the results

#

Integer hash function from Thomas Wang written in Jan 1997

dawn palm
#

#define THINGY
"hello"
printf(THINGY);

#

fails

glossy inlet
#

Ah found what you mean

#

C99 requires whitespace after macro name

#

C++ is not C99. Neither is Arma preproc
C++ is C90. With just few selected elements from C99, seems like this specific C99 "feature" was merged into C++11. But still. Arma preproc is not C/C++

Additionally.. Arma preproc was probably written before 1999 or very shortly after C99 came to be. Before C99 was made. Before that limitation was added to C. And WAAAY before it was added to C++11

So the preprocessor of Arma is complying with the standards from when it was written.
But with your latest tools update that perfectly fine, standards compliant thing is suddenly a bug?

Not that standards compliant even matters. As was said several times, Arma's preproc is not the C/C++ preproc

split briar
glossy inlet
#

I mean. It's your tool. If you feel like it's the right decision to break something that worked fine in your tools before and works just fine today in Arma and other 3rd party Arma preprocessors without telling anyone just because you feel like it should not work.. Then we can't do anything about that. Besides moving to different tools which don't radically change things to not conform to Arma because the authors thinks it's the right thing to do.

smoky halo
#

please unban commy2

#

Yes please.

vague shard
dawn palm
#

If you feel like it's the right decision

I set the standards for paramfile binarising, not bis. There are five separate compilers in the bis engine and tools, each one of them, have a separate set of bugz, each one of them have idiosyncrasies of their own. Don't quote me, am easily confused but i believe the FSM compiler expects space before \, fairly sure of it. Other variations crash on trailing commas in enums and arrays while others don't, the differences go on and on and on.

I supply a unform. consistent, rapifier for them all where one shoe fits all sizes. model.cfg, Rvmat, fsm, bisurf, mod.cpp. mission.sqm, desc.ext are all born equal in my tools. And to achieve that, rules apply.

People are free to use bis tools and accept the results, but if they want a more reliable result there's some coding standards that have to be met. Yes, backward compatibilty is always desibrable. But this little nasty has produced some unpleasant and unnexcpected results.

glossy inlet
#

preproc != binarizing/config parsing.

Yes I agree there are many problems in the config parsing. But there is only one preprocessor in the Arma engine. And as far as I can see it hasn't changed for many years and should be the same across all tools

Still don't really see the reason for this change.

Yeah, newest C99 preprocessors don't support that, but why exactly is that a problem? What "unpleasant and unexpected" results does this cause?
It has been in Arma since forever. And in your tools for years, why is it suddenly a problem.

dawn palm
#

Unsung raised the issue with me about 8 months ago. the cause was the \ but the effect was buried deep in the use of that define inside other defines. I don't recall the exact details. But cfgConvert got it wrong both ways. Agreed, this is an upset, but first time it's ever been raised.

#

If I can go back that far in my notes Dedmen, I'll post you with a pm.

sour hedge
#

@dawn palm, is there likely to be a revert in your tools for the new handling of the macro \ issue as you and dedmen were discussing? We probably have thousands of entries spread across hundreds of files where we don't have <space> before the \, so could be quite a lot of work for us to change, and don't want to do it if you might revert to the previous handling in the near future. Thanks.

dawn palm
#

looking at making compatibility

sour hedge
#

thanks, that would be very nice

vague shard
#

@sour hedge you may want to look into regex. should be super simple to mass replace those

#

ie ([^ ])\\([ \t]*)$ => \1 \\\2\r\n

sour hedge
#

Thanks kju. I'm hoping that with a special mikero patch it won't be necessary at all, as any mass change like that requires much testing to check nothing odd happened.

vague shard
#

do you use git/svn as backup/diffing and such? plus using mikero lint checking give us very high confidence to make such mass changes without a fuss and regularly

dawn palm
#

@distant vessel , I can't garantee an immediate fix, or possibly no patch at all. I would never make such a change simply coz I felt like it. Not built that way. There was a good reason, and just being 'better' is not one of them. Me more than anyone harps on and on and on about the necessity to maintain backwward compatibility. I have to go back serveral months of emails to check what the issue was (and test it again). Something is nagging at me about fsm files, but I can be wrong about that too.

#

you can't be half pregnant. You can't have one paramfile behaving differently to the others. That's the pathway to madness, where you stare at a screen of code wondring why it works on fridays but not on saturdays.

sour hedge
#

@vague shard, is your suggestion to replace all \ with <space>\ automatically? Won't that also break file references in configs?

vague shard
#

above regex will do it only at the end of line

sour hedge
#

thanks

#

we'll probably have to revert to old tools for the time being and then work out a plan

nocturne basin
#

There is also the regex buddy
If you would ask me, a have to for everybody using regex at any point in time

#

Must have

sick verge
#

Looks great but its not free so I'm out 🤷

nocturne basin
junior beacon
#

@nocturne basin Looks good already

spiral forge
#

biggest 10 minutes ever 😛
but the issue here is if the text can be way more than one line;
so maybe make two big text input and an entry selector

nocturne basin
#

also the actual channel thingy

junior beacon
#

How would I work with 10 languages?

nocturne basin
#

you typically translate 10 at once?

#

no

#

you typically want to go through one by one with a single language

spiral forge
#

still comparing only two languages seems fine; I like that

nocturne basin
#

also can implement auto translate

junior beacon
#

I see what you mean

nocturne basin
#

what yet stands out: load, save, restore

#

but that is actual 10 minutes of work

junior beacon
#

Would it be possible to create groups?

nocturne basin
#

technically, everything is possible

#

this is just a first draft

#

could also give you a treeview that actually handles proper project, package etc. stuff

junior beacon
#

Red Hammer has a programm which uses a tree view, I liked that alot, much quicker to find stuff.

#

I wish I could programm things like that myself =/

nocturne basin
#

i actually would have liked to add this to arma.studio

#

but the rewrite is not even close to being finalized enough for something like this

junior beacon
#

@nocturne basin Someone who would like to get into programming stuff like that? Any good resources you could recommend?

nocturne basin
#

download visual studio, fire up some WPF project and just "start" 😛

#

it will take time, cause a hell lot of headache but you will manage

#

keywords to look out here are: XAML, WPF, Bindings, MVVM

spiral forge
#

bwerk

#

X39, if I give you the lib, wanna do the interface?

#

trying to get rid of the responsibility 👀

junior beacon
#

Yes Lou, since you have to format all BIS functions on the wiki, you can't spend time one working on a new stringtable editor

spiral forge
#

…game, set and match

#

…and my mission, dammit!

glossy inlet
junior beacon
#

Tabler suxx

#

Never hear of de_stringtabler

glossy inlet
#

Made it just for TFAR stuff because I had to move strings around alot. Also has some experimental stuff to find string translation usages in scripts, and tell you about missing ones

junior beacon
#

Sounds nice

glossy inlet
#

screenshot is there. Just latest uploaded exe on github releases is broken and doesn't show all strings. I already fixed that long time ago, but didn't upload a new build

#

Also allows for stuff like adding notes to entries which no other stringtable tool that I've seen so far supports

junior beacon
#

And if I use an older one?

glossy inlet
#

0.11 is broken then same. I don't know why really. But I remember fixing that stuff

junior beacon
#

I see

nocturne basin
#

ohh ... and removing keys ... forgot that feature somehow 🤔

craggy lake
#

Udemy has a WPF class for $10 right now . @junior beacon I bought it, but haven’t started it yet.

junior beacon
#

Can you send me a link?

drowsy shore
#

For just 2 hours it looks promising already.

dawn palm
#

Any good resources you could recommend?
obviously? visual studio, any edition, plus

"The C Programming Language" by Kernighan and Ritchie

It remains just as relevant today as when first published in the 1970s. All later C version (C++, C# dotNet, php, perl, jovial, Java) start from there.

pearl beacon
#

@junior beacon care to elaborate on "Tabler suxx"?

nocturne basin
#

@pearl beacon i can tell ya

#

it is not clear what a user needs to do in the first few seconds

#

it is written in a way, that requires you to already have a stringtable.xml

#

and generally speaking: it feels like "you like excel don't you? here we have a stringtable to excel thingy"

#

and that is what i found after 5 minutes of usage

pearl beacon
#
  1. add a big button in the middle to open a stringtable file on startup
  2. how else can you edit a stringtable without a stringtable? that means changing code, which should be written with stringtable from the beginning, anyways, creating a new file would be an easy change to tabler
nocturne basin
#

new file is a requirement kind of 🤷

pearl beacon
#

why?

nocturne basin
#

but personally, would not touch the bloody tool anyways simply because it is using forms

#

@junior beacon probably got more reasons
as said, those were my findings after 5 minutes of usage

#

and now there is StringtableEditor as pre-release 🤷

#

why new is a requirement?
ever opened your texteditor? what does it do at the very begining? greet you with a new file 😉

craggy lake
pearl beacon
#

my text editor doesn't greet me with a new file, neither do many others
anyways, it simply works well exactly for what it's been designed to, simple stringtable editor for translators, maybe just not something you need/want, good luck with yours though

nocturne basin
#

wondering what text editor you are using then 🤷 because pretty much all do
or at least with a corresponding landing page

#

the editor i created is fairly simple to use too and just took me 2 hours to get to there

#

loads of stuff still theoretically required

pearl beacon
#

well, landing page is not a new file

#

and tabler has a landing page

nocturne basin
#

tabler has nothing

#

when i started it, it literally was the normal view

#

just that i could not do anything ..

pearl beacon
#

landing page can be blank 😛

#

and I said, that's a simple thing that could be improved

nocturne basin
#

in which case, it would be a new file

#

does not matters that much: as i said, i would not touch the whole thing in 2mrd years due to it using forms and got "asked" to do so

#

or more ... i said "gimme few mins" 😄

pearl beacon
#

that's obviously your choice

#

the 2 objective feedbacks you gave is the only thing I care about

nocturne basin
#

indeed

#

still

#

if somebody was not familiar with the software

#

and would launch it, he would have no idea what to do at first

#

and it really is ... "just" a stringtable to XML editor thingy

#

which technically could be done by utilizing excel itself too

#

and some visual basic

#

feel free to try StringtableEditor test release btw.

pearl beacon
#

most people would go for "Open file" right off
sure, which is exactly what it's meant to be and is said to be on the front page

#

I don't use any helper, faster writing XML directly than launching UI programs and clicking stuff

nocturne basin
#

true indeed

#

though ... will need to for my job
but that is not stringtable.xml but rather resource files which are urgh .... getting them synchronized already is a hazzle

pearl beacon
#

but anyways, "tabler suxx" statement deserves some much stronger issues to support it, if it simply doesn't accomplish one's tasks, it doesn't necessarily suck, so I am interested in what R3vo has to say

nocturne basin
#

gave you for that a valid argument: it is a glorified "stringtable.xml to excel" thingy

#

so ... maybe the context will reveal more for ya

pearl beacon
#

and that's not supporting that statement at all, that's exactly what it's meant to be, it's literally "X sucks because it does Y, which is exactly what it's meant to do"

dawn palm
#

the original stringtable csv was cleverly engineered.
the first column indicated the default language for that csv. It was not necessarily English.

all other columns indicated other languages and as a convenience, any blank entries used the defualt 1st column,. There was even the abiilty to have comments.

pearl beacon
#

XML does default language on per-string basis, whichever is first is default (you don't need "Default" language at all), non-defined language uses that default in XML as well, XML can also do comments 😛

nocturne basin
#

I will not comment the fact that you actually think XML is not Supporting comments @dawn palm ....

dawn palm
#

i'm aware of that Jonpas, merely commenting that the csv as implemented, had those features too.

pearl beacon
#

that was very random then -.-

dawn palm
#

well it becomes relevant again in dayz

nocturne basin
#

@pearl beacon He just hates XML for some reason
And loves the csv thing (where I already brought up arguments against starting at the parser and ending at the clearly limited Format)

vague shard
glossy inlet
#

I use regexr.com ¯_(ツ)_/¯
Though I think there was another one that's better

For mass replacement or search I use notepad++

junior beacon
#

@pearl beacon Saying that Tabler suxx was probably a bit harsh of me. However, using it to work with a stringtable file with 4000 entries is almost impossible. At least for me. It lags when scrolling through the list, and worse, there is now way to search for strings.

#

I reckon you are the creator of tabler?

#

I you are willing to update your tool I can provide you with some suggestions/feedback.

glossy inlet
#

He's not the creator. And tabler is not a mod.
It's on github. Just create feature requests there

junior beacon
#

Roger that

sick verge
#

Just throwing in that my SQDev Plugin also has a Stringtable-Editor ☝

#

Even with container view

junior beacon
#

I'll update the wiki page and add those tools.

#

Anyone knows what the one from Red Hammer Studios is called?

#

StringForge, right

dawn palm
#

The free version of depbo64.dll has been updated to accept

#define THINGY\

rotund rampart
#

thx for the suggestions @junior beacon

junior beacon
#

You're welcome. Let me know if you need more feedback or need someone for testing

rotund rampart
#

at some point i will probably update the UI (framework). I dislike Win Forms like every decent human being but I haven't found the time yet to do so 😄

junior beacon
#

I see

pearl beacon
#

@junior beacon fair enough, and yeah, github, but all was answered I see :)

rotund rampart
#

@junior beacon could you give me with one of those 4000 lines stringtable files?

smoky halo
#

@pearl beacon The way you defended it yesterday I was sure it was your tool

glossy inlet
#

@rotund rampart Arma 3\dta\languagecore_f.pbo

#

I guess 4,7MB is enough?

pearl beacon
#

@smoky halo I didn't defend the tool, I was merely interested in issues because I know issues actually getting reported would help @rotund rampart , those just babbling about them don't contribute anything, and I fought lousy arguments

junior beacon
#

@pearl beacon It was definitely not my wish to cause any trouble. I guess I am kinda frustrated. Creating huge translations is already a pain in the arse. But if then one does not even have proper tools which can get the job done it becomes even more of a pain. I don't even know why BIS doesn't have a public stringtable editor in Arma 3 Tools.

#

Anyway, I am happy that @rotund rampart is still working on tabler.

obsidian sluice
#

Because our tool can't be used by public

junior beacon
#

Interesting? So you have a special tool

obsidian sluice
#

It would have to be reworked

junior beacon
#

I have always been wondering what you guys use for those huge stringtable files.

rotund rampart
#

Excel :kappa:

obsidian sluice
pearl beacon
#

@junior beacon understandable, why do you have such large stringtables though? Sounds like someone has to split up something into some components

junior beacon
#

I could do that. However I find it easier to work with one large file.

cinder meteor
#

I think we can't break one .xml file into multiple .xml files in ARMA, right?

#

And then combine them into a single stringtable

junior beacon
#

Not sure, can we?

cinder meteor
#

I think I've tried it once, my arma crashed or something like that

nocturne basin
#

uhm ... mhh?

pearl beacon
#

Multiple PBOs is what I meant

nocturne basin
#

think that is not what @cinder meteor was talking about

pearl beacon
#

I didn't say he did

cinder meteor
#

I actually understood you exactly as using multiple PBOs
But I meant, in .XML there must be some standard way to include another .XML, right? Or is there not? And if yes, does Arma support it?

nocturne basin
#

lets say it like so: there are ways to do that

#

but i would not recommend doing it

#

better: use a proper tool that works with those XMLs for you

#

and dependign on what XML reader BI uses for arma, it might not even possible at all

dawn palm
#

well the engine aggregates all stringtables into a single master, similar to the way it merges all config.bins. One humungous stringtable, is contrary to oops modelling where you'd really want to keep STR_MyGreatTank_blah, inside a discrete pbo. Providing people use the STR_mytag_ conventions there's little chance of collisons between the different xmls

junior beacon
#

@dawn palm Might a stupid question, but is there a simple way to get acces to that one humungous stringtable ?

#

I reckon one could use the default BIS translations for their own mod?

pearl beacon
#

of course you can

#

and you should if strings fit

dawn palm
#

@junior beacon . Sorry, i should have said one humungous external stringtable (is not a good idea)

glossy inlet
#

@junior beacon dta\languagecore_f.pbo

#

that's the vanilla stuff.

#

Sure you can get access to the final merged one and export it.. Though not with... legitimate means

dawn palm
#

bis have confused theselves with aggregation of mission strings, which is justifiable, vs addon strings. Using any external xml/csv for an addon, condemns that addon to that engine and, indeed that version of the engine. The slightest, totally unrelated, correction to the table, forces a huge download payload for no reason. It's probably due to their xml editor not written to handle multiple files.

junior beacon
#

Thanks for the answers

glossy inlet
#

The slightest, totally unrelated, correction to the table, forces a huge download payload for no reason. Uh.. Yeah.. You have to download that single 5MB pbo when they modify it.
Instead of let's say the pbo with the tanks models. If the stringtable were in there you'd download 500MB or more for a few changed bytes (ignoring delta patching)

dawn palm
#

only if the changes were for the tanks pbo, and there are a lot of addons less than 5meg

#

even so, a 'trivial' change to it's stringtable can just as easily be a 'trivial' change to the config.cpp

#

It's sheer common senes. you alter something that's only related to the tanks.pbo, you download the tanks.pbo

glossy inlet
#

Yeah but in BI's case that would be really inefficient

#

If they add a new language. You'd have to download everything, instead of just that one 5MB pbo

dawn palm
#

good point

smoky halo
#

Only a problem if you are on dev branch, getting next release download you kinda expect it to be massive

nocturne basin
#

isn't steam utilizing diff based downloads anyways?

#

at least i would be disappointed ...

#

never actually checked that

glossy inlet
#

yes

#

That's why I wrote (ignoring delta patching) cuz steam does that. Which is also a reason why one big stringtable also doesn't matter

dawn palm
#

others will have different experiences, but it mattered greatly that our cwrX models were self contained when when we ported them from a1->a2->a3, (and now dayz) Over 50+ addons in each of the mods.

#

in fact it went further back than that where we self contained the models coming out of xbox elite before even bothering with cwr1

dawn palm
#

and self contained means just that, each p3d 'owned' it's own paa and rvmat files in the same pbo

vague shard
#

looking for some second opinions here to make sure we understand the clutter selection algorithm correctly:

so you have a pair of clutter models and their probabilities - sample definition:
probability[] = {0.98,0.03,0.02,0.015};

the follow code determines which one is to be used for a given position
the random generators return no evenly distributed set as its bit shifting based - however bottom line is values between 0 and 1 should be generated

    int seedXZ = randGen.GetSeed(xx,zz,layer);
    // relative position in the grid (0..1 in both directions)
    int isHere = -1;
    float isHereF = randGen.RandomValue(seedXZ);
    for (int i=0; i<surf.Size(); i++)
    {
      float prop = surf.Get(i)._probabilityThold;
      if (prop>=isHereF)
      {
        isHere = surf.Get(i)._landIndex;

        break;
      }
    }```
so what does this do and lead to from your understanding. ty
cinder meteor
#

I think it does what you have described. Generates a number, then checks all probabilities in array against threshold surf.Get(i)._probabilityThold. If given generated number is above threshold, then isHere gets value surf.Get(i)._landIndex and the loop breaks;
There is also a chance that index will be -1 because the generated number was below threshold, but I guess that's also a valid outcome for your algorithm?
If you need something like I want random outcomes from a given set with probabilities {Pa, Pb, Pc} of each outcome, then probabilities must be scaled so that their sum Pa+Pb+Pc is 1.0, and probably you would generate it with a different algorithm. Probably code above is OK for grass though?

vague shard
#

If given generated number is above threshold
if (prop>=isHereF)
isnt it the other way around - when the generated number is equal or smaller, then it breaks

#

or in other words the value must be below prob, for the set to be choosen

cinder meteor
#

Yeah you are right. I'm used to thinking that if there is a threshold, then something must be bigger than it :\

vague shard
#

the way its setup is kinda confusing

#

usually one would do this differently i would assume. however it could come from the value set generated by the bit shifting random generator

cinder meteor
#

What's the problem with it? Doesn't it work as expected?

vague shard
#

probability[] = {0.98,0.03,0.02,0.015};

#

the way the community understood it so far:

#
  1. sum may not be >=1
#
  1. its a probability for each clutter
#

where above source suggests it checks a position for each probability one by one, and breaks if the random value is below probability

#

which also implies the values would need to be ascending, or would never be true

cinder meteor
#

if (prop>=isHereF)
If it doesn't trigger for highest probability in the array, it will surely not triger for any of them 🤔

dawn palm
#

no. none of that is true.

#

since it generates a new number on each slot, 0.90, followed by 0.10 is valid

#

it tests for 0.1 just as equally since the 0.9 failed and got tossed

smoky halo
#

You think that ._probabilityThold is probability[]? It is definitely not

dawn palm
#

ah!. ah hah haaaaaaaaaa. good one, got it.

vague shard
#

since it generates a new number on each slot
it does for every position

dawn palm
#

testing ascending. descending or mixed, all are valid, in any sequence

vague shard
#

@smoky halo what is _probabilityThold ?

smoky halo
#

What is surf?

vague shard
#

surface

smoky halo
#

What is surface

dawn palm
#

texture

#

oops, let me check....

vague shard
#

const SurfaceCharacter &surf = _surf;

smoky halo
#

Is it a struct?

vague shard
#

do you have the source?

#

or just playing devils advocate here?

smoky halo
#

Surf looks like an array to me

dawn palm
#

surf = names[]={"cwr3_malden_Grass_BrushLow_Sharp,,,,,,,,,,,

#

(class names)

vague shard
#
class CfgSurfaceCharacters
{
    class StratisForestPineClutter
    {
        probability[] = {0.05,0.012,0.01,0.1,0.05};
        names[] = {"StrBigFallenBranches_pine","StrBigFallenBranches_pine02","StrBigFallenBranches_pine03","StrGrassDryGroup","StrGrassGreenGroup"};
    };```
#

testing ascending. descending or mixed, all are valid, in any sequence

#

vs

#
    int seedXZ = randGen.GetSeed(xx,zz,layer);
    // relative position in the grid (0..1 in both directions)
    int isHere = -1;
    float isHereF = randGen.RandomValue(seedXZ);
    for (int i=0; i<surf.Size(); i++)
    {
      float prop = surf.Get(i)._probabilityThold;
      if (prop>=isHereF)
      {
        isHere = surf.Get(i)._landIndex;

        break;
      }
    }```
#

if (prop>=isHereF) ... break

#

does tell me it does matter

dawn palm
#

.9 is Obviously going to be selected more often that 0.1

but, the next value in the sequence, will fail (or pass) on it's own merits

#

it doesn't 'fail' simply because the previous value failed

smoky halo
#

Ok so all surfaces are parsed into array from config and each has _probabilityThold float which correspond to the probability with the same index from config

dawn palm
#

as we understand it. yes.

vague shard
#
void GroundClutterPosMap::Generate() const
{
  if (_loaded) return;
  
  PROFILE_SCOPE_EX(grGen,*);
  int x = _x;
  int z = _z;
  int layer = _layer;
  RandomGenerator &randGen = GLandscape->GetRandGen();
  const SurfaceCharacter &surf = _surf;
  
  _pos.Dim(x,z);
  _isHere.Dim(x,z);
  
  // generate a position pair for each grid location
  for (int zz=0; zz<z; zz++) for (int xx=0; xx<x; xx++)```
#

just making sure you dont misread the context

#

it checks for each position, it generates a random value, looks which clutter to use - however when the first is found, it takes that

dawn palm
#

of course

vague shard
#

which means if the following are smaller, they wont be taken - never
from what i understand

dawn palm
#

no

#

your thinking is wooly

#

it is NOT testing against the same value that caused the 1st to fail

vague shard
#

if found, break, look at next position

#

a new random is ONLY generated for each position

#

not for each check

dawn palm
#

oh wait woah

smoky halo
#

Well break is so that you can have only one surface at that index

dawn palm
#

the above paste of code is wrong

smoky halo
#

Or no surface

#

Not sure how that is handled if none fulfils condition

#

It basically random selects a surface based on seed at given xy

#

Or no surface

dawn palm
#

sorry kju, i was wrong, i misread the original source code

#

forget what i said, i will 😷

smoky halo
#

The higher threshold the more chance for the surface to appear

#

But with that break the surfaces listed first would probably have more chance over the rest

dawn palm
#

probability[]={0.02,0.02,0.02,0.25,0.45};// right
probability[]={0.05,0.45,0.05};// W R O N G

#

i don't (now) see now 0.05 can ever be selected

#

.in fact i can't see how all the other 0.2's can ever get thru either

smoky halo
#

Yep 👍

dawn palm
#

phew 😅

vague shard
#

it seems a bit like a programmers (math) skill exercise without taken into account the actual later users lack of understanding how that simple array definition relates to it/turns out in reality

smoky halo
#

So where is this code from?

cinder meteor
vague shard
#

yep

#

but thats not in line with RV engine 😛

cinder meteor
#

I don't get where is this code being executed then. Are you pre-calculating some things and putting them into config? Or what is it?

dawn palm
#

i think one of the other, probably major, issues is how authors define their clutter

names[]={red,green,.blue,orange};

and THEN the author selects which one he'd like to see most

probability[]={.9, .1, 2, .3}; // BANG

smoky halo
#

So what is selected is random is 0.91

dawn palm
#

ie, what he's not doing, straight away, is not listing his names lowest to highest

#

all the other names will fail M242, because he didn't list them in lowest->highest order to begin with.

#

big IMHO here

smoky halo
#

I don’t know if no selection is an option or there is a default selection in the engine otherwise there has to be a fallback entry with 1.0 at the end

dawn palm
#

class cwr3_malden_hayfield_character
{
probability[]={0.15};
names[]={"cwr3_malden_StrGrassDry"};
};

#

if it 'fails' there's no clutter. i don't see an issue.

smoky halo
#

Ok so it could be this or nothing

dawn palm
#

yep

#

which is fine

smoky halo
#

Yeah

dawn palm
#

but I also think we've had a double whammy misunderstand of how clutter is generated. Notaby lowest to highest order

smoky halo
#

Should have been {{surf,prob},{surf,prob},...} format so you could at least sort it by prob

#

That would not solve identical value problem though

dawn palm
#

true

vague shard
#

well thats a fair point. maybe the engine does order them by prio at any place

smoky halo
#

What is this terrain builder or game code?

smoky halo
#

@dawn palm @vague shard our assumption is wrong

#

it is not how it works

#

maybe the engine does order them by prio at any place very likely

#

Well I was right about _probabilityThold and probability[] not being the same thing