#code-talk
2 messages · Page 12 of 1
yeah and then team restrictions, basically fh global
like a game show?
such as ?
Such as a war room
like foxhole global ?
?
theres a few sites that share the global map structure, such as sethfires
but not quite what I meant, I suppose
Technically like Foxhole Global but more like Radio Commander and Radio General
I've been considering it, but I'm a programmer not a 3d modeler
god projects like these i really remember im not a javascript programmer and that i hate it
and I'd need to work on that rather fulltime if I want to actually make something useful out of it
at best that stuff would be in Unity
mmm unity, where i can use c# 👍
But the idea of a 3d war room client (instead of a website) did throw me for a loop
uhh why not make it a website? unity fits in websites
can a website do 3d tho
stuff like this? https://www.youtube.com/watch?v=QrYF7mNxFZ8
Learn more: https://store.steampowered.com/app/1011610/Radio_General/
http://www.foolish-mortals.net/radiogeneral
It's WWII. You're a general sitting in a tent. All you have is a map, and a radio. Can you win the battle? Radio General is a unique strategy game where you inter...
Cuz while foxhole global is nice
the map loads in on the fly
it feels... slow
which funnily enough is the same problem that the Heroes and Generals client suffers from
what feels slow?
much like google maps it loads in slower than I can move around
and doesn't draw until I stop zooming in or out
welcome to the web
ah
if i built my site from start again, its try and do it all in html5 canvas
boy i think id do mine in blazor
(the map part atleast )
im so sick of working in javascript at all
It would be cool to get the whole thing to give that world war vibe as that trailer above
once in a while this channel is neither dead nor microelectronics
i mean, all of this stuff should be in foxhole proper
like some sort of communication and direction room, a war room
the game itself needs an addon/mod abilty, but ther be dragons
If only we could combine Radio General and Radio Commander https://www.youtube.com/watch?v=xubccklbVwo
General might be somewhat ahead of Commander
i really want to try this game now
something very special and different to play a game with voice
But this is my wishful thinking, the ability to have your leadership in a 3d war room where people can move around little figures on a map that updates according to your faction's intel and where you might even be able to send out orders to the people playing Foxhole for real.
a 2 way api would be cool
well, a discord voice room would be the next best thing, but that stuff can get messy
especially when you want to have only one guy run messages between the leadership and the soldiers
yep
some kind of in built game commander room would be good that gave people in there spacial actions and ability
like a structure built
so it becomes a strategic target for enemy
while giving benefit to team
like a bunker addon
the best thing to do would be make up a proposal and share it around, and then wait about a year for the devs to add it, like mines
Yeah. Though it would be preferable if anyone entering the structure is removed from the list of players as having 6 people in there discussing strategy is 6 less rifles on the front or 6 less trucks in the backlines
yeah there would be some kind of limit to it, but also way of sharing it around
with people of enough rank
That said, it would be an operation thing as giving out orders to randos who play alone is never going to be well-received
i would opt in, and im a random
actually that would be very cool if you could give waypoints and requests/commands to players that they see, they can ignore it or not, but would give good option for players looking for guidance and something to do
oh yeah
and help coord everyone
randoms arent asexual, theyre just not looking for a relationship, know what i mean?
recently more than you'd care to imagine
anyway
So you might have a general order for randoms who opt-in and another set of orders for operations and/or squads
Man, this is getting me excited again
ok so how do we control/decide who gets to be commander/s ?
u mean not available to soloers or not done by just one person
(not sure if u ever played bf4? commander mode, it was similar)
the latter
sure thats why i said commander/s
then we need to work out who gets to do it , if assuming there is a limit on it
and what happens if people dont like who`s doing it
simple invite system
what could work, would be that apon recieving an order, you could acknowledge it or disregard it (key press) and this forms the basis of voting system, if too many people disregard ur orders u either get booted from role, or there is option to be replaced by someone else
invite by who ?
crazy to think they really did that
I'd imagine that depending on the number of people who opt in you can divide who gets command over what
no it cant be opt in
opt out?
I find it hard to imagine that someone who just wants to play an hour or two of foxhole after getting home is eager to get hit over the head with movement orders
maybe opt out, or just ignore/vote disregard order
its would be sublte though, just like a message in the corner not in middle of screen
and show waypoint on map
, u can ignore it, or reply to work towards it or disregard it
like the technology notification?
oh what
I have the foxhole global open and I just heard presscorps
fuckin neato
but tbh the technology notification is something I miss most of the time
getting shot at and all
but you make it like not fade away
Like the squad invitation?
its just up there "current orders"
yeah that could work
Hell, you could make radios more interesting this way too
standing orders get updated alongside map intel
and the radio backpack could allow you to reply, either with voip or from a list of responses
nah too much
¯_(ツ)_/¯
i think you could have voice chat with commander though regardless
by request
so like u making a call
skype tune
so basically commanders orders build up their 'karma' points and lets them stay there or be replaced, also people going to given waypoints could earn points , but we cant call them points as devs cry
You make it sound like it's a timer that gets replenished by people giving you the thumbs up
pretty much
ehh
upvote/downvote
that's more like it I suppose
As doing nothing with shit going down should earn you downvotes, but doing nothing when there's actually nothing to do shouldn't get you kicked out.
a good commander benefit would be seeing player names next to icon in map and icon types for friendly vehicles,
If every soldier and vehicle is a little figure on the map it would get really crowded really fast
maybe you just get that data on hover
I suppose that as you zoom in and out they blend into figures of multiple soldiers or break apart into figures of single soldiers.
like these
Other question though
would it be global (what I'd like) or regional?
Or both, which tbh I don't see happening as that would be dozens of players just playing commander instead of soldier
Would be cool for Foxhole 2 tho
not sure, could be both, i only imagine there being max 2-3 slots per team per map
2-3 commander slots?
yes
globally, that's not a lot of leadership for 70 people per region
2-3 per region
Though that would probably be narrowed down to 20 people who actually care enough to follow the orders
not counting big clans
2-3 per region
The dream would be to have people on the global scale give general orders that people on the regional scale try to put into action by giving more specific orders.
But if there's one thing I wish could be coordinated on the global scale it's logistics. I don't like how you have to look at the FOB/BB inventory on the map and then guess what it is they need the most.
(Or ask, but you'd probably get only 2 answers that contradict each other anyway)
would be good if players could vote on items 'in stockpile they want, and then that gets summurized at logi station rather than having to look at each fob in map
And then you might have someone like me who just really wants sniper rifles
yes, that would be good
or what about a currency system ! where u could actually order stuff and have it delivered
I don't understand why there isn't such a vote system, particularly with how you can now vote on base upgrades only if you have your spawn set there.
or what about a currency system ! where u could actually order stuff and have it delivered
Invest commends into a communal pot for specific weapons and ammo
And whoever completes the order gets the commends
yeah cool
1:1 might end up creating a lot of Field Marshals over a short amount of time though
and a partial completion would net you a partial amount of the commend pot
as well as or instead of commends it could be resources, that way it gives front liners an incentive to collect them for logi return trip
Possibly
The war room idea gets me all giddy, but by now we're talking about a full on feature inside the game, which knowing the devs would be 3 years away if they even decide that it fits the game.
i know, this is the sad thing, it seems like we have active devs and they engage us, but really changes still take too long, as theres always bugs, nerfs and new vehicles for them to focus on
thats why it would be cool if they opened the game up to a 2 way api for approved community devs
I might put in some weekend hours if that were the case
but even that would be a big project for them, and i dont think they would like the work of maintaining it, they struggle enough with the current api
(which could do with some improvements)
any chance of getting something like that off the ground would be a seperate client with the one way api
and I'mma be honest, as much as I love dreaming about it, I still haven't got a clue how to design or build it
we all learning
first 3 weeks would be just figuring out how to wrangle the api
and then how to get it to do more than just draw on a 2d window
even if I worked on it 9 to 5, it would still be several months
¯_(ツ)_/¯
and fuckall documentation too 
Plenty of people do that already
either as full on playable stuff or just 10 page google docs of game design
it feels like submitting funny jokes to be used in the family circus newspaper comic - theyre never gonna use it
That's pretty much with every suggestion board where you don't get to talk directly to a dev in charge
so they basically deleted the suggestions channel ?
it's the game feedback channel now
But even the most upvoted suggestions just get passed over
you know as developers we believe in this myth that theres some way they could have made foxhole where mark was just coasting and not stressing
and theyd have time for outside input 
im sure its constant damage control and putting out fires most of the time there
I mean, I don't pretend to think they have the time to sit around
But there definitely are design choices I don't agree with
which are also the least likely to change based on outside suggestions
i added viewer count
even a one way output data API would be great
using interrupts/events/hooks or something
from the game ?
yeah but I am probably thinking client side, where you were thinking server side
the thing is client side API could open up potential to do more than just export map data, but also could do things like allow you to capture where your character is on map and maybe you could use 3rd party software to transmit that information automatically to your clan's discord channel or something
so if for example a whole clan is doing operations, they could see where all their members are located on map from API or something
yeah cool
in terms of security/privacy, a client side function would allow a person to opt out for sure
sending out chat text through API would also be wonderful perhaps
client side would mean you would have to be logged in and actively playing the game for the data to be retrieved in this case
voice chat can theoretically already be manipulated without API since it goes through hardware drivers
wouldn't take much probably to write a driver that copies the speaker output back to line in/mic and play that back to a discord voice channel, though you probably can already do it in something like soundflower anyway
its a novel idea, you can also use memory tools to read a games state, so u dont even necessarily need an official api
@pure sierra yeah thats a straight road into vac banana
not sure it is outlawed specifically
I mean there are ways around VAC but probably not good to talk about it
if you ran windows in a virtual environment, perhaps you could still read the memory from the main OS but the virtualized environment probably wouldn't know
that would definitely be a far stretch
@barren quarry so do that include the overlay arty calc ?
apparently
I thought that thing was calculated on pixels or something, haven't tried it though
@barren quarry i woeuld think technically yes too
like if you know the current screen resolution and you have a screenshot of the map the program could make an accurate calculation on that probably
I think what Max is referring to mostly is better safe than sorry because we don't know exactly how VAC triggers
a little common sense probably goes a long way too
i would love if a user could query their location. obviously.
that would be as epic as could possibly be
Everyone would
it seems so achieveable, i want it so bad now
so you generate a private key, you encrypt the steam id by that private key and you display it as the user's API key
wouldnt be a crazy security issue that way
i cant imagine its a ton of work to export the height map
doesn't have to be done all that often
A height map =/= a topographical map. It's not as easy as you imagine it is to generate (else we'd be doing it for our own maps). A height map is just black & white data used to generate terrain (and the way it's stored in engine isn't all that usable). The maps themselves are not scaled realistically either (most of our topology is tiers of flat terrain)
its not easy to generate a height map? yes i find that surprising
it seems like thats what one would ideally make a topography map from tho
Get the height map, join them together, load them into a GIS (or city skylines for that matter), display heightlines, export/screenshot, overlay gamemap with file, add rocks and the like
Now to automate that, that is the real challenge and I bet the devs have more important stuff to work on. Also, knowing (and paraphrashing Matt) how the terrain is basically a set of plateaus makes it very hard to make any automated sensible looking topographic map.
This is what the heightmaps actually look like (this is Deadlands). It's not exactly conducive to usable topography. You can maybe see where some basic elevation is in the map, but you can glean that much information from the maps as-is.
Because the scale isn't realistic, it's just not as useful as it would be if say I generated a heightmap from a real location and then turned that into a topographic map or imported that into the engine.
Is it possible to make it work? Yeah. Anything is possible. Is it easy to automate into a process that works in our pipeline without a lot of manual intervention? Absolutely not.
https://www.worldofleveldesign.com/categories/ue4/images/043-ue4-heightmap-guide-01.jpg
This is what you'd really need.
i think that even in that form the images could be quite useful when considering gradients
yeah, it is, but it's not detailed enough to really disseminate any information at the infantry level, where that kind of thing would matter more. This level of gradation is already used to generate the in-game maps.
Hm, now I'm reminded of a panel on terrain generation
They talked about how they went from this
to this
If you're making like, say a first person game. You'd use some tool, like Houdini or World machine to generate terrain to use for Vistas/a base for playable terrain.
🤔
matt, i must say, thats all i want. are those images just like you posted.
i could make a topography map from that i think
and i dont need all the colors and stuff, that deadlands heightmap is exactly what i would wish for
my knowledge of maps, tho, is much weaker than my knowledge of 3d terrain
can i see the rest of those, tho? just looking at deadlands is blowing my mind. i had no idea that NE area was highlands
its like a big valley of a map. never realized this before
my mind is on fire after seeing this!
you never realized? its quite easy to get a sense of deadlands weird and wild variety
I'm actually not going to supply these because unfortunately it's not really my call, nor is it feasible every update.
Maybe after 1.0 we can come up with a system that generates heightmaps along with the map images, and posts them to some community folder.
I'll inquire about it
but right now it'd all have to be manual.
nice to get your reply @neat fossil , what area are you mainly working on there at the moment ?
I work on a ton of stuff. 😂
the first thing that comes to mind which im sure ur aware of is the vaulting is pretty hit and miss at the moment, quite frustrating
ok 😦
@pure sierra Imma be honest with you, I snoozed through the presentations on REST and APIs so I'm gonna need some help understanding this war api
you just load the url, and get the data
I'm not
what lang ?
C#
@long raft
with php i do curl requests
likely similar in c#
essentially server side command to make a GET request on url
GET is what browser does when u load a page
My PC is fucked atm so I'm trying to figure this API out while I wait for a new power supply that should fix the problem
i've only built like 1 or 2 APIs in .net, ya know with asp.net core
i found it to be very easy, but dependency injection is confusing
oh but reading the war API is pretty easy
thats all he wants
oh but reading the war API is pretty easy
making fun of me :(
lol i have one example of reading the war API and also hosting a map request API lol
I flat out suck with httpclient
but its like 400 ugly lines jammed together in 1 function
private Dictionary<string, (string ETag, string data)> JSONCache = new Dictionary<string, (string ETag, string data)>();
private async Task<string> GetJSONStream(string URL)
{
(string ETag, string data) CacheElement;
bool Cached;
lock (JSONCache)
Cached = JSONCache.TryGetValue(URL, out CacheElement);
var request = new HttpRequestMessage() { RequestUri = new Uri(URL), Method = HttpMethod.Get };
if (Cached)
request.Headers.Add("If-None-Match", CacheElement.ETag);
System.Net.Http.HttpClient webclient = new System.Net.Http.HttpClient();
var response = await webclient.SendAsync(request);
if (response.StatusCode == System.Net.HttpStatusCode.NotModified)
return CacheElement.data;
var stream = new System.IO.StreamReader(await response.Content.ReadAsStreamAsync(), System.Text.Encoding.UTF8).ReadToEnd();
if (response.Headers.Contains("ETag"))
{
string ETag = response.Headers.GetValues("ETag").First();
lock (JSONCache)
if (JSONCache.ContainsKey(URL))
JSONCache[URL] = (ETag, stream);
else
JSONCache.Add(URL, (ETag, stream));
}
return stream;
}
ditch c#
And as an example I called it like so:
var api_result = JObject.Parse(GetJSONStream("https://war-service-live.foxholeservices.com/api/worldconquest/maps/" + map.ToString() + "/dynamic/public").Result);
not very good async/await there. oof.
anyway thats like ... exactly what you need. query the API, check the etags and use the cache when theyre not out of date
returns a string you can parse into json
my code for updating a single region is 106 lines long
normal people use axios
but axios cant fucking cancel requests on state change
so you have to do it with XHR
i really hate looking back at useful but ugly old code i wrote
If youre using VS might be easier to use an HTTP client from a package for requesting stuff
Should be easy to find
it's included, System.Net.Http.HttpClient
im not sure if you have to actually ... nuget that or what
i seemed to think it was part of the framework, either way its microsoft's code
their old system.net.webclient was downright awful for https queries
still feel its a bit bothersome with the default one
its a good library but its heavy handed with the async stuff
look at these pretty builder interfaces
Fluent URL building and wrist-friendly HTTP client for .NET
i think thats actually longer than my code using httpclient
Is it though?
I see a lot less code in those examples xd
Though the main benefit is probably how testable it is
I don't think the system http client is very test-friendly
well my code block does more, but the actual httpclient code is like 4 lines
Ive got nothing against your code
Just saying it might be easier to use a simpler interface
is it still going to be simple if you have to check and cache the etags?
Im not familiar with it, but the cache ofc. youd still have to do yourself
getting a header value should be a oneliner tho (also doesnt .net now have thread safe implementations for dictionary? i thought so)
yea it does
Ah
not sure how i feel about the concurrent ones tho
Probably not when you wrote that
sometimes theyre useful, sometimes not
oh no i wrote that like 18 months ago
concurrent dictionary has been around for like 15 years lol
I dont have to do concurrent stuff with shared resources often
Just keep everything stateless 
Whats crazy about it?
its confusing unless you read about what it is and how it works, its just not intuitive
like, its just Monitor.Enter() and Exit() being called
but thats also where youre supposed to mutex releases and waits and stuff, is inside that
intuitively it seems like doing that would cause a deadlock
like in the C world, definitely.
Hm
Using Monitor.Enter() by itself is not advised cause it's easy to DL
Thats about all I know about it :>
why lock statement exists
also it cant do everything the monitor object can, but its like it's own try/finally block where youll never forget to monitor.exit
^
but causes ugliness in certain logic
/maps
yep
someone should make an API standard ...
maybe something based on XML ... with a big intricate request and response format ...
but we'll call it "simple"...
maybe im the only boomer here whos used SOAP
everything microsoft does it really well planned and totally over engineered
this is exactly why I always say C is the best language because it is basically able to achieve what assembler can achieve, it is great for manipulating strings, and easy to understand
but I don't do anything graphical, that is another department
if there is something you cannot do in C# you can always write it in C and make the functions external and compile it into a DLL or object file to use
i cant imagine what you cant do in c# that you can do easily in C lol
although i think c# 9 will kind of fill all the remaining things c# cant do that c can
well C# was made for windows, literally, window screens
unmanaged function pointed support coming...
i mean i beg to differ. c# is open source cross platform
there is absolutely nothing in c# specific to windows
mono was just a way to bring C# outside windows
yea but dotnet core is not mono
C# was always a microsoft thing though
i used to code in c#
c# is open source
yes me too back in like 2004
i tried to learn .net core to get a job but i failed because its so boring
so i switched to js
js is pure hell
I could never get into windowed stuff I prefer backline server side or embedded stuff
Js by itself is the worst language ever
actually, js is an OK language, i hate DOM and js projects
JS with typescript and react is a cocaine whore on ferrari
the thing is server side never gets fame because nobody sees it
wildallan, i dunno why youre so windows focused, dotnet is not a windows thing
it started originally by microsoft
ok but microsoft is not windows
half the technologies you use were started by microsoft
theyre kind of the huge player in the industry
and C# does not compile source the same way other languages do, it relies on a runtime to operate
you know C was like that too, maybe you like C but then it all depends on who makes your C compiler
all languages require a runtime
C does not it executes directly
what are you talking about
c absolutely has a standard library
glibc
you cant just run C code without the runtimes either, you can statically link stuff but its still got a runtime. you can do the same with c#
yes but the difference between C and C# is C is a real language that creates machine code and C# just creates instructions for a runtime, sort of like a script
that is why you cannot manipulate memory in C# basically
and c# compiles to IL, which is compiled on first run into the same "machine code" as C
yes you can
you have all these incorrect ideas about c#
at best you could say a C compiler compiles code into a machine-code-like language thats OS dependent
still depends on a library. they both can manipulate memory in the exact same ways
C literally makes machine code, I dont know how else to explain it
but it doesnt
it is not OS dependent but it is architecture dependent
you cant explain it because youre taking somebody's over simplification of it
it is absolutely OS dependent
this is why a linux binary is different than a mac binary or osx binary or windows binary
the os will translate the executable so it can be executed as machine code
c# is not an interpreted language, its eventually compiled before running
it is not considered to be a compiled language if you google it
the reason is that a real compiled language produces machine code that will run on the same hardware regardless of the operating system

i keep telling you, c# is compiled into the same type of code as C
neither of them is raw machine code
c# has an intermediate layer, "bytecode"
so you're saying in C# you can allocate memory?
most of them basically don't support it because it is low level programming
allocating memory is like ... very basic
you couldnt have a modern language that cant allocate heap memory
nothing like that exists anymore
18 years? jesus christ how old are you
old.
i started young, i was in high school when c# came out
id already been programming for like 5 years
i was like a c++ whiz back then
so you're like 34
36
in "purest" form. yea well c# doesnt need a runtime in it's "purest" form either
meaning you cant do anything
C# is pretty far from pure
its true the c runtime is thin, because the OS is implementing most of it
man what are you even talking about
you dont seem to know a lot about C or c#
you're right I mostly work with electronics, but C and assembly are what I use
you know, system calls in assembly are basically a runtime also
that's interesting because I never had runtime execute on any of my programs
so youve never used printf?
printf does not cause dllhost to start running
it is literally a CPU call not really something you need a runtime for
uhh dllhost is like a program just for running commands
you can still use the runtime without starting dllhost
printf is not a CPU call
thats c runtime
certain functions in C, or rather most functions in C are CPU calls that is the big difference really
yes but those basic functions in the standard library are almost all CPU calls, not really something that is extra
it depends on what library you are referring to, in this case the standard library is almost all CPU calls - why, well, that is the basics of how computers started and you need some baseline functionality to be able to make an operating system
i mean, string outputs to console is an interrupt, but printf is a complicated function call that does a lot more
string does not actually exist, that is why any language that uses strings is not a real language in my books
LOL
like you said, everything links back to libraries - string is literally a function of a character array
characters (char keyword) are of course a CPU function
bruh dont get stuck in 1960
string is not a CPU function
I hate to break it to ya but none of the 70's became outdated - every computer in existence now and into the future all use the same basic CPU calls
any time you use the string keyword the compiler is putting the zero character termination on the end of the char array internally
no its not
most string implementations have an integer with the string length they maintain
shit, even stuff from the 70s did that
you would see the zero termination character on every string if you used the debugger on any binary
no thats not true
you can also see the CPU calls as the debugger puts everything in assembly
computers all basically work the same, whether apple, acorn, microsoft, HP, etc they all have the same way of terminating character arrays with the null character
I doubt that C will ever die, because it's the building block of every modern system
agreed
when you program with CPU calls in C or asm instead of using a modern language like C#, you will understand what I am saying
the difference is huge in terms of efficiency, a C# program will have to revert to a library and then a runtime which converts all that information into a way the CPU can work with it
smh
a C program on the other hand, when it is compiled, all those basic functions are directly linked to CPU calls so there is no need for a runtime
i mean, i hope you dont try to tell someone that at a job interview who knows
if I wrote my apps in C# I would never be able to program my
20 cent microcontrollers because they have only like 64 bytes of memory to work with
yea but not because the reason you think
yes, mine don't need runtimes - I wonder why
oh boy.
I know it is because they are made in C or asm so no runtime needed...
it is not possible to write them in other languages like python or PHP or perl because those are all high level languages that rely on runtimes
those are interpreted languages, totally different than C or c#
C and C# can't be put on the same level because they arent on the same level
you might want to update your encarta '95 and get some fresh understanding on these languages
these are old myths i remember
it is not a myth
ive had enough C/asm master race for an entire lifetime
from people who are usually pretty new to both
seem to think theyll inherently write faster code
C# is high level language C is low level language
see, thats cute to me. C is considered a high level language, i feel like we've talked about this here
you know why C is not considered high level?
thats a trick question
high level languages use runtimes
because it is a high level language
what you are referring to is likely C++ not C
🌍 👨🚀 🔫 👨🚀 always was HLL
assembly is considered low level. and its still not machine code
man im sitting here at 3:26 AM with my brain turned off and i havent a slightest idea what the hell are you talking about
i feel like im the only one who knows what anyone is talking about lol
i've had experience with c++ but never c
this feels like a stackoverflow post with all negative scores
I mean I could say you are new to programming based on what you said, but I am trying to help you not to make you angry
like saying C doesnt use a runtime, when the runtime is like millions of lines of kernel code
or C is low level? is that what they teach kids in school these days?
for the last time, C does not use runtimes... lol
except for the famous c runtime
microsoft has a C runtime for .NET code compiled as C-like, but it is not true C language
there is no true C language
other than that there is no such thing as a C runtime
afaik GNU C sets the standard for C now in modern day programming, and GNU C does not require a runtime to use on any OS
so if you didn't have the C++ redistributable installed you could still run .NET C++ programs?
if you compiled a c++ program not to use any c++ libraries, yea
same sort of thing with C
frankly, you could compile php the same way
C++ redistributable is not an OS, it is literally the runtime
most of the community calls this a runtime because it literally has to run a second program in the background just to run the main app you want to use
its not running a second program
its just running code in a linked library
i mean, i see c# is going to be running a garbage collector in the background, i see how thats different
well let's go back to the basics, why did shell32.dll have to run on windows 95 if you wanted to open up most programs?
shell32 is explorer isnt it?
no
oh the shell library
i mean the libraries have to be loaded in to be used...
since theyre dynamically linked
only the non-standard libraries do
i would make a point that dynamically linking a library is not the same as running another process
it does have to run as a separate process
windows 10 simplifies it by using RuntimeBroker
the dll calls in shell32 execute under the process of the program that calls them
and if that process exits, then your apps that rely on it go poof
if the library gets unloaded your program will crash
yes
why would the OS unload the library tho
there is no library needed to run to use printf, you know why?
I mean
pretty much every CPU, Im even going to say this ATtiny10 that costs 20 cents and is the size of a piece of rice has printf embedded in the CPU as a main function
but it is part of the c library
except it doesn't have to use the library as a reference
youre saying the library is physical hardware
you can directly call the CPU call if you want to
which i ... i just dont think its accurate
the library just makes it easy to read than a bunch of numbers
i ... i cant speak to microcontrollers. i know x86 assembly. and i know there was no interrupt for printf
the standard library is literally all the functions that are embedded inside the CPU
no way
that is why it is called standard library
string is not standard hence why you have string.h
malloc is a c library call. it allocates memory. that is not a cpu instruction
thats an OS system call
you're right because malloc is not really an instruction
none of them are
but there definitely is an instruction for memory it's just different
i cant speak to every microcontroller, but you know in an intel cpu just calling a function is an instruction itself
let alone all the code inside...
malloc can allocate multiple bytes in one go, the instruction only allocates a small amount at a time
theres no cpu instruction that allocates memory to my knowledge
theres instructions to move a stack pointer, if you count that
so malloc is really a function that calls the memory instruction multiple times to allocate enough memory
memory allocation needs to be done by the OS so it can manage and remember where the fragments are being used
and what are those OS system calls? how are they made?
the c library
passes the request to the OS, the OS handles the memory...
im not an expert at modern assembly, but i dont know of a memory allocation instruction
I am asking, what is behind the OS system calls
code
opcodes?
i assume its calling interrupts on the CPU
you know, a lot more than single instructions
again, speaking to x86 assembly, youd do several instructions to prepare an interrupt, then you call the interrupt
so you take some embedded device, but its really running minix or whatever other realtime OS on it, maybe linux or whatever
and its got the c library compiled into it
maybe im ridiculous for calling that a runtime, but that ... that fits the definition of a runtime to me
so my 64 bytes of memory somehow have the c library in there?
yes
on the chip
in eeprom or whatever
do you literally mean 64 bytes of memory? like wtf is that good for?
I can actually have the thing spit out all the contents of memory and I just see direct CPU calls
and you dont see any system calls?
well it doesn't exactly run an OS
i mean ... are you sure?
like every single intel chip has minix on it. it has a full unix OS on it
100% sure on that
maybe this is why all programmers need to spend a year and learn how hardware works
...
it will give you a strong clear understanding
so this is what I run on my 64 bytes of memory
theres not a single memory allocation or system call in that
it is fairly simple really, 2 push buttons and 2 outputs that go to transistors to switch relays with
that code doesnt need to use the c library
no system calls? are you sure?
unless NOP is calling a function, i assume its compiled into a NOP instruction
but yes, i can see how that would run without libc
#define nop() asm volatile("nop")
yah that all can be cpu instructions, thats very simple code
you could compile C++ to an executable that doesnt depend on a c++ library too with that code
the library is actually just a reference to the boards and the define calls are all direct CPU calls
the whole program is shifting bits into CPU registers
but i think if it did a malloc or printf it would have to call libc
which i assume is just embedded on the device
so is it literally 64 bytes of memory? like wtf thats so tiny
not 64k?
you cant write much code with like 50 instructions
well it can actually do quite a lot with just a small memory
you know how efficiency plays into things
but only 64 bytes?! you couldnt even store a string with 7 characters
if you need to use a runtime, your program isn't going to be as efficient as if it were running line by line of bits shifting into CPU registers directly
it wont be as fast, but its perfectly "efficient"
but you likely cannot write faster code than the c library
that stuff is rock solid and old and tested
I like this so I can simulate the program inside the IDE and see how it will run my program
the red boxes are changes to the CPU register, so a solid red box is a change to value of 1 and an empty red box is a change to 0
why does that IDE look exactly like visual studio
is it just made to look that way? or did they license it?
probably because microsoft plagiarized it
...
man youve got a weird anti microsoft thing rooted in the 90s i think lol
that seriously looks like plugins on top of visual studio or something
thats remarkably similar
it's more similar to MPLAB which was the programming interface people used long before visual studio existed
really? do you know how old visual studio is?
23 years old
man after talking with thecuz1 about vs code, i gave it a try again, i havent used it in a couple years. its still lacking important things i want/need but damn it sure has come a long way. gonna be doing my php development in vscode now
I had to google that one, I thought VS came out in 2004 but apparently there was one version before that
eh many versions before 2004
only one before 2004 according to wiki
well i had visual studio 2002 and 2003, so...
2004 is when C# came out, I was in the Longhorn project on MSDN
maybe im remembering that incorrectly?
nah c# goes back to 2000 evidently
i wasnt using it until 2002
longhorn was uhh .. windows vista?
or was it windows 7 ?
vista
there was a lot of hype for vista...
yeah so C# was around before 2004 but it didn't get popular until 2005
depends what you mean by popular
popular as in more than 20 people using it
i dont feel like its ever really gained popularity
microsoft had a massive marketing campaign for it
for .net, not specifically c#
it was supposed to be the first step to going open source at microsoft
they pushed vc++.net really hard, and then killed it like 18-24 months later
What's the difference between .net and c#
they didnt really go open source with .net for like a decade or more
c# is a language, .net is the runtime
if i were making an analogy to javascript, c# is like javascript the language, .net is like the browser that runs it
C# was great but what makes it bad is multiple points of failure
I see
no matter how good you make a program it is only going to be as stable as the runtime
its fantastic as a language, but youre subscribing to object oriented programming and managed memory. for most cases thats a benefit but for some thats crippling
Derp doesn't believe me when I say C# is not a real language, but you can google "why is C# not a real language" to understand why
well frankly you seem like youre making up stuff
imo it is basically something between a shell script and a half baked potato
i think you subscribe to this idea that c# is bad or slow or microsoft and so youll believe things that arent correct
it is because I prefer C or asm for everything
thats fine. we all have our golden hammers, but i wouldnt say C isn't a real language just because i dont like it
they are the only two real languages left
Does C have libraries?
yes
As in, a package manager so you dont need to invent the wheel every time
most programming libraries are in C
no package manager
you just have to know how to use stuff
your IDE can install libraries for you, if you count that as a package manager
you don't need any packages to run a C program unless it is linked to something else
i bet nuget can do stuff with C libraries
yea, if you want to make a C program that doesnt do anything or have any output, you dont need libraries
if you attempt to make a program that actually interacts with the world, you will definitely need libraries
otherwise youre basically writing your own drivers
but even then, if the C library you linked to directly calls CPU functions (or as Derp says OS system calls which are really CPU calls) then you don't need to worry about runtime or DLL files or any of the sort
Like in us you can just hit npm install, spawn a folder with 39000 package files and instantly write whatever you want
This is what I meant
In js*
theyre not really cpu instructions tho, certainly not on amd64 architecture
here's a big question for ya, is amd64 limited to AMD?
i mean, i try not to work in C anymore, but in my experience there is no legit package management
you just have to include the header files in the top of your code, and you have to compile the static libraries in your linking
no amd64 architecture was adopted by intel as well
its the standard 64 bit architecture on PCs
it killed IA64
intel and AMD aren't the only companies making 64bit CPUs
Ok I have a very autistic question I always had
yea this is why i said stadnard PC architecture
Why the fuck is 32 bit called x86
obviously not your 64 bit smartphone
because uhh ... good question
the 80-86 was a 16 bit processor, then the 80-386 introduced 32 bit architecture
x86 refers to the x86 specification for how a CPU should be made
the pentium is a 586, so theyre following the "x86" numbering scheme
it is also proprietary
Interesting
its just a model number
it's not limited to intel, but they own the rights to x86 architecture
yah other manufactures have figured out how to copy the interface
remember those "OS system calls" you say, which I refer to as just CPU calls
the OS just converts them into the CPU calls for the arch based on whether it is x86 or whatever, but they are still CPU calls
some things are instructions, some things are not
if you add two numbers, thats an instruction. if you allocate memory, thats a system call
the OS has to convert if it supports multiple CPU architectures, so if you had a program for x86 you would not want to make an x86 call on amd64
because C is a high level language, its not obvious which things are instructions and which arent
but other than that you could instead make the CPU calls directly in C or assembly
the problem is C# emulates inline
and that's why you dont understand why C# is bad lol
you dont even know how it works
the problem is runtime languages cannot communicate directly to a CPU
first c# compiles to byte code, where it lives architecture indepedent. then when you run it, it gets compiled to your architecture
it's just not possible
uhh i dont even know what youre saying
well if you are managing memory manually then you have to access the CPU directly
and thats where you are not understanding
if i write c# code to iterate over an array, the code will be the exact same machine code if you wrote it in C
OS cannot actually write to memory, the CPU handles that
who poisoned your brain with these ideas?
yes the cpu writes to memory, and reads from memory, but the OS manages the memory
you have to make a special call to the CPU to write or read a memory address
the OS does page swaps
it does the allocations, the heap walking, the collection of lost memory and freeing it
those are all operating system calls, not cpu instructions
they are translated directly to CPU calls by the compiler
you cannot even use heap memory in C without libc
yes, eventually all code is translated directly to CPU instructions, even PHP or python
you just have to do it by assembler language injection
no you cant lol
you make the cpu calls directly with asm
if you made your own assembly to allocate memory, you would be re-writing the c library call for it
why woudl you do that.
how ... how would you even do that
if you use a C library to do it, then the compiler will convert it to a CPU call
not a single call. hundreds of thousands of calls
you're right you wouldnt do it, the compiler would, but you /can/ do it
the thing is with C# you cannot send the calls at all, they are emulated by the runtime and sent that way
no they arent
stop saying that, youre wrong
open up a book
go read how bytecode works
c# is not interpreted. youre just simply wrong.
and this is why theo de raadt does not use C#
Because he doesn't google?
well the thing is, C# is great for beginners, when you see the light you move toward C
i mean i dont see c# working for your device, but it does exist on embedded devices, ya know like an arduino, and its definitely not interpreted
bruh i was mastering C before you knew how to type
then after you learn C you start building your own 8 bit computer to understand how and why a computer works
C# does not exist on embedded devices because it relies on runtimes
C is an awful experience, unless you have to use it and thats your only option, and its really not anymore
yea i agree with that, although its on some embedded devices with the runtime
arduino is a bad example, it is basically the microsoft of the microcontroller world
it is bloatware
no true scotsman huh?
its a bad example because its counter to your "none" argument

c# is a language for professionals. C is a language for chinese programmers and hobbyists (not racist, you know micro architecture is all getting made there)
java too... professional
C++ still relevant anymore to anyone besides game programmers?
well apparently it's relevant to foxhole
maybe disk uses c++ for embedded programming
yah i think ... i think C would just be too difficult to build a large project in
when i started game programming it was pretty hot, lots of people were using C/openGL
how would C be too difficult? Factorio was made in C
and c++/opengl, i think all the C games/engines are dead and gone
was it really? wow.
a quick google says c++ tho
yes, why do you think it was such a smooth running game
can you cite a source?
it has crazy amounts of entities on screen with no lag even on a potato
that is my first source
my second source is the fact it uses a C game engine
it all comes down to efficiency
C++ could use a C engine you know
i could use a C engine with C# too
i dunno i cant find anyone saying it was written in C, i see it was written in C++
well most C programs are compiled with a C++ compiler anyway, you're right about that
" The game engine itself is pure C++ because of (1) performance reasons and (2) it's the programming language the devs are most familiar with."
im glad im not betting my life on your claims
Allegro is a C game engine
but factorio is written in C++
i dont understand this claim that factorio runs smoothly, it doesnt for me
and the language choice doesnt matter at all
its not like the tiny amount of code written in the game logic will have any bearing on speed compared to how many triangles its trying to draw
ok im not arguing allegro. all the sources say factorio was written in c++ using allegro
so ill go back to my point i guess, its too hard to make big projects in C
javascript, like C, is such a slim language, it just doesnt have a lot of features for managing big projects well
ok but that doesnt .. say factorio was written in C, i think you just made that up because allegro is
you know my C# code uses a lot of C libraries but i wouldnt say my programs are written in C
the game engine is the biggest performance hog in most games
the rendering, yea
that's why it being made in C is very significant
why do you think that would make it faster?
the rendering is done by the graphics library, not the game engine
so vulkan/directx/opengl
quite frankly because it does not use C++ or C# redistributables as I tried explaining the whole idea around runtimes
this is why you can write games in c# and python and stuff easily
and they have nearly similar performance
python would be horrible to write a game engine in lol
it would be fine
again, the heavy lifting is done by the graphics library, not the game engine
you would need probably 200 gigs of ram just to run it
this is nonsense
man you are really red pilled about C, itll fade in time
when you work for weeks on a hello world and realize your time is worth more
each language has an intended use really, python/php/java were meant for client side web applications
python a client side web application? wut
php doesnt even run client side
youre just trolling me now
C was intended to make building an OS easier compared to assembly
what I mean by client side, is you never see a program written in PHP that opens up a socket, it is intended to produce web pages which are a client side object that is transmitted by a server to another client
yes you can make sockets in php, I have personally never used a program written in php that opens a socket
other people do
I have however used apache php extensions which do not make sockets
many people use php as their scripting language
apache is the software that makes the socket, php is just interpreted by the server software and generally used to produce an interactive output to a web page
outside of using php as a module in a web server to produce interactive web pages, there is practically nobody making anything popular/widely used in php as a server program to host
python actually has quite a bit of things made because it's more efficient than php, but the problem is that you still need a runtime/interpreter for it, just like you need a runtime or interpreter for C#
a big question to you is, if you think C# is not an interpreted language, then why is mono needed to run any C# program on a non-windows machine? (of course windows has built in support for C# since it's a microsoft proprietary language)
java also needs runtime support, ie: JRE, though, I don't need any runtime installed to run most C++ programs and none needed for any C program
mono is the runtime. you need the libraries. its not interpreted
seriously, it would take you like 3 minutes to google it
runtime is an interpreter
theres not a source alive that would say its interpreted
well there are plenty of sources in paperback
the runtime includes a compiler used to compile it to os-native instructions
it has never been an interpreted language
there will be no printed book that says so
it is unfortunate that the Internet is a place where the majority have a voice that is bigger than the voice of any engineer
perhaps said engineer doesnt know what hes talking about
maybe the majority simply is right
Brian Kernighan is the guy who invented C and helped invent C++, I wonder what he has to say about C#...
youll find the same arguments about java, which are slightly more relevant
uhh
where do you get your facts from
I get my references from books written by the engineers who made the languages - why - because who else would you get your information from?
dude i dont want to play your C is better game, i just dont care
im just getting triggered with all the incorrect facts
it's just my opinion, but I believe nobody is truly able to write programs in any language with comprehension about what they are really doing until they have started from the base, which is assembly or at least C
there are other base languages like B, but you would probably need to make an 8 bit computer or buy a kit to start with a language lower than asm
Brian's book on the C language from 1978 is still in print by Pearson ISBN: 0131101633 ISBN13: 9780131101630
straight from the words of an engineer https://www.youtube.com/watch?v=CYvJPra7Ebk (though I don't necessarily like Linux, it is his world)
Creator of Linux Linus Torvalds explains why there is no language he knows of that's better than C for writing optimized code.
https://runtimerec.com
#runtimerecruitment
#embeddedrecruiter
I'm not convinced at all, but I'm glad I watched the video
its clearly important to him as a embedded software engineer
what he wants is ... a glorified set of macros for assembly with reverse polish notation in a language
linux is far from an embedded OS, I mean, it works on some RISC processors but it's too heavy to run on any AVR
thats his job title
and yeah I was victim to windows update again
does a raspberry pi count as embedded?
microsoft's response is to tell me that my computer is not compatible with windows 10, but in reality it's the bloatware and automatic driver updates killing it
you know we would have counted a car stereo as embedded device like 10 years ago, but a raspberry pi is way smaller
probably similarly expensive
they want me to buy windows 10 workstation edition for 125 bucks... lol
my friend programs satellite dish receivers and is considered an embedded device programmer
uh
yes those would be
there are many sites you can get a working copy of windows 10 for 15-30 USD
raspberry pi is not really embedded
why isnt it embedded? because its not strictly limited?
it's considered a full computer
embedded would be like an ATM machine or cash register
but its literally a ... circuitboard, especially with like the pi zero
i know it has all the components, but when you can buy these for 10 dollars and theyre that small, why arent they embedded
typically ATM machines still run COBOL because of the efficiency and ability to directly access CPU registers and such
if i were building a hardware device now, i think i would rather build it around a small pi device
raspberry pi is a full all out computer that's the difference really
right but so is my calculator
you can't run an operating system like windows on most embedded microcontrollers
there was at one time a version of windows called Windows Embedded but that is not even the same kind of category as a windows OS
isnt it an arm device? i dunno if i can run windows on arm or not
i havent seen anyone running windows on their pis
don't know never tried it, but windows probably might not have ARM support
i would bet money its possible, with some weird limitations
people are just using pi's instead of embedded devices because theyre so much easier to develop for
and theyre inexpensive. theyre filling the same slot
the reason linux can run on it is because the operating system is open source and that meant people were able to modify it to run on ARMv7/ARMV8 etc
i dont understand what makes something embedded or not - surely not just its capability
there is an arm version of windows
embedded is basically something that uses a real time operating system instead of a regular OS
so basically my example of the ATtiny10 is not embedded either really since it can't even run an OS, or at least you would not have enough memory to run one, and it cannot do complex math calculations either
but you know, linus really is a real-time guy.
if so, then embedded device programmer would fit
embedded still uses an OS but a real-time OS, in that it can run apps but cannot multitask them the same as a normal OS can
most AVR/PIC/STM32/etc could run a real time OS
yep, familiar with real time os
ok ok so if i put a realtime os on my raspberry pi then is it an embedded device?
you would have to burn it to the firmware on the chip as that's how embedded OS is run
raspberry pi has its own firmware that manages how it boots, so instead of running an RTOS from the firmware it has firmware that searches the SD card slot for a regular OS to boot to
but its real-time from there
this is so people cant hack it? like put linux on their playstation 3?
if you put an RTOS on the disk it won't even boot because it's not a regular OS, usually RTOS is a hex file or machine code type file that you have to burn to the chip as firmware
if they aren't firmware they are just acting like an RTOS
i dont see the distinction
because RTOS is where you directly manage the CPU
if you could define "directly manage"
directly manage as in, you have to get the manual print copy or PDF of the cpu and search what the programming of the CPU requires you to send and what kind of signals to send, the timing of the signals and which pins to send them to
and of course which protocol, since there are so many protocols
ICSP is the most common probably, ATtiny uses TPI protocol to program it, that is, a protocol which outlines what pin to use for what function and the type of sine wave/digital pulse to send to it to make the CPU store data in its firmware
you wouldnt let the compiler do that?
compiler makes the machine code for it but you could theoretically write out the opcodes and hex yourself
well if you want to torture yourself
the thing is most of it in C is already basically opcodes
i assume if you control the kernel then your compiled os would be doing all of those things
all those DDRB and PORTB commands you saw in my code are basically opcodes which are like for example digital signal representations of let's say 0xc0 which would be an instruction for something and then you pass a value after that instruction which would be the data for the instruction to process
yah thats just like kernel code
the compiler converts it from "DDRB" text to the proper opcode
when you made the distinction of realtime os, i thought yea i can see how the software determines if something is an embedded device
so i would think yea if it has a real time os on it then its embedded no matter what
the program that is used to upload the hex code tells windows how to tell the programming device how to program the chip, and the programming device translates that into pulse/sine waves at specific frequency needed to program the processor
right, i get that programming the chip is harder
but thats no different than punch cards vs a keyboard for making software
the signals have to be precise which is why a human can't just touch a pin to another pin to do it, they often have precise timing and thats why everything in the end uses a crystal oscillator for perfect timing
but youre saying the difficult manufacturing process and a real time os is what makes it an embedded device
i dont see why the manufacturing or printing or programming process changes it
it's the fact that since it directly controls the CPU, there is no latency, that's really where the advantage is
if it was a real time OS, then it would have no latency
the other big advantage is power savings
it would have deterministic latency, i mean theres always latency
another huge one is it uses far less data
ok but low power cant be what makes something embedded
because whatever ... current you say is the limit, im sure the raspberry pi will get there
im not arguing its more efficient
just that its affordable enough to replace them, and its much easier to use
this is also why stuff like OpenWRT is inferior compared to just buying a real router, because it runs on top of an OS like linux so it loses out on efficiency compared to an embedded system that directly controls everything with no bloatware in the middle
well that stuff used to be expensive
also there are security issues with stuff like Linux, if you have an embedded program that is set by basically sending a pulse wave to the CPU, how is a hacker going to reprogram it?
but also if theres a security vulnerability in an embedded device how can you patch it
like old nintendo games printed with all the bugs
that argument has a flip side.
generally once they are programmed they are never reprogrammed again, but they allow external data to be added via SD cards or whatever
theres security issues everywhere, no OS or especially IoT devices are reliably secure
heck some can't be reprogrammed, I can send my code to microchip and have them burn the program onto my ATtiny10 with no option to change the program, and for 500 bucks they will encrypt the machine code so it can't be copied by reverse engineering
yeah IoT have issues mostly because they have telnet servers running on them which is a huge joke
but also that is because they are often running a full OS like linux
well because they arent servers, theyre all developed as clients and they connect outward
vulnerable to man in the middle attacks, theyre not using SSL well or outdated certs
and theres a data stockpile on some remote server that can be stolen too
usually hackers can't do anything to embedded firmware, it's the add-on software they target