#code-talk
2 messages · Page 17 of 1
Idk
ffs "military licensing issues"
You know how many cocks project aces has to suck to put in all those dozens of real life jets in their games
They list all of those licenses on the loading screen
the ace combat games?
Yes
trying to find a picture of it now
Yeah well it is the defense industries' IP, to their credit
You think they had to pay a lot for licensing cost as well?

its funny how they never ask Sukhoi or any other russian companies
Wonder if maybe they could reduce that cost to zero by just making up their own jet names
Yeah thats what Project Wingman does
and if the designs look familiar? oh gee um well
and also cs 1.6 did that too
change wing span length 
like calling the FAMAS the FR 5.56 smh
maybe they factored in the cost of a potential lawsuit from them and was like fuck it, not worth the trouble
They don't ask russian companies because they're based in Russia and already have permission
project aces is a part of namco which is japanese
yeah i know about gaijin
They're only in Cyprus to evade taxes

i play the current spin off of the ruse engine/empire, steel division 2
I tried to buy Steel Division 2
Well I did, installed it, spent 2 minutes seeing that the US was shoddy DLC and immediately requested a refund
server update
screenshot of how the collies were cheating with the mht
nice

"Wait, it's all trial and error?"
"Always has been"
Never been big on documentation
This looks net good luck with the border glitch?
?
To me it looks like the border of the map is overlapping with with the molds I could be wrong
I don’t know much about what your doing but it looks really cool
Oh I’m sorry I don’t know a lot about this stuff but kudos to you for doing it
@kind glacier so cooool!!!! Tell me how i can get this :P
No
so hows this, my post showing screenshot of collies cheating with MHT was pulled off reddit because it got popular and involves discussion of cheating !!!
If they’re fixing vechicle exploits they gonna fix the 40mm on barges
@pure sierra Where's your post about Warden veterans discovering and using the FOV exploit for two years before it became mainstream and the developers removed it, and, as Stranger Days would term it; taking pride in the matter. Or you know, how both teams taught newbies ways to exploit rocks to climb to gain a better advantage, the refinery glitch, or other backhanded manners of gameplay?
Look we can dwell on these things and try to muckrake for them; but at the end of the day it's just human ingenuity going outside the bounds of a fixed system. It's not reprehensible and it's not criminal; it just needs to be remedied with a hot fix.
For what it's worth I agree MHT balancing acts are unfair; but keep in mind people on both sides have been doing this with artillery for the past two years.
@kind glacier looks very cool.
this is our sanctuary where we discuss coding
do not dare desecrate it with foxhole drama
i didn't go here to vent when we lost 5 wars in a row due to silverhand having no counter
and you shouldn't either
Silverhand go brrrr
https://i.imgur.com/fxqWzJE.mp4
You spin me right round right round like a record baby
@kind glacier are you going to make the hole map 3D at some point?
I have seen Warden SH ops, and that is exactly how they start and end
I'd like to see just the town icons become 3d but the map remain 2d. Else it gets cluttered and you will have to start solving how to display units on a 3d graded surface
(in response to hunter)
While not impossible, I'd need 3d models of the buildings for that
@kind glacier What files do you use for the 3d models? Like the file extension.
I'm not a 3d modeller by any stretch but I could probably make a placeholder. Or better yet, the devs might give you the 3d models for the townhalls/world structures.
@royal glade #code-talk message
@zealous sonnet Region zones don't follow the voronoi diagrams anymore? This point is clearly closer to the relic base than to the town hall
and these are the region zones i generated using the voronoi diagrams
Reaching trail still mostly matches though
Callahan's passage is wacky on the west side too
The rest of the maps seem to be a near perfect match
the only issues seem to be with stonecradle and callahans passage
you are probably using the wrong seed points
if youre using the dynamic list, it probably is the ones from the static, or vice versa
i recall there being some minor difference in precision
omg what if they were using elevation 
@kind glacier . Neat! Are the 3d files .stl?
Perhaps they have done it on porpose, as I feel the original Calahan passage makes more sense with the angle of the region border
If you look closely, you see the subregion borders allign with the northwest scatered rock formation and the center east zigzag slope road
For reaching trail, they did it based on that you shouldnt be able to capture the west most subregion if you captured the second-from-south subregion (bypassing the capital subregion)
Stonecradle idk, maybe better visiblity?
@long raft holy shit you're probably right
region zones are bound to text labels
ahhhh it makes perfect sense now

.fbx
Wait, you are saying the text labels are a seperate object from the structures?
@languid harness they have always been
each map has two endpoints, one for dynamic data and one for static
the dynamic endpoint contains icons and the static contains labels
and the labels are divided into major and minor
secretly a little disappointed only public information is accessible
But I understand why
@barren quarry interesting
A big suprize is cooming
@void marlin 
Wait, this games models are .FBX? I think half life alyx uses FBX...
isn't FBX like the game standard now and for the last decade?
that format was taking over like 15 years ago even
It's autodesk proprietary
I mean, I'm used to source and their MDL's.
But either or, I could do VR-tours of all the tank models!
Question: is there a collection of fullscale images of both the whole map and the tiles?
the repo with the tiled versions doesnt really help me in any ways
usually one of us puts it together
i sent it to him already
has it changed significantly? recently?
@long raft imagine godcrofts being an apple and someone took a bite
and also bulwark got moved
goldenroot got reintroduced?
crap ... i ... i dont think im going to redraw roads
i think im done with that project lol
i was going to see if i could use image recognition to do it automatically
but they didnt update the sat maps
you cant even use human eyeballs to do it
the sat maps had the roads in bright orange
plus the road tiers havent been visible since that devbranch, so youd have to go see them in person
i was under the impression we could extract the sat maps from the assets, but i guess not anymore
yes we can
someone said they werent there anymore
they're just from the previous update for some reason
oh
well i dont feel like the devs help us much, i appreciate the github being updated but we get more and more locked out to the data and world every month
think im done, will save the project if i ever try to go to work for garmin 
thank you for your service
has anyone ever done a pull request on the warapi repository?
like if i added the map and the leaflet tiles... and did a pull request
this was the only pull request
@long raft these days i update the tiles pretty much on the night they come out
do you post them?
i have a script that combines the region images
and then i cut them with your thing
and then i update the repo
yeah i did
that tile slicer is ... hmm its fast, works fine until you get REALLY big images
i need to rebuild it to use a better image library, gdiplus is weak sauce with huge images
oh and then i run another script that just compresses all images in a folder
it basically shits the bed when the image is 4x-8x larger, like if you have double resolution
decreases tile size by like 44%
ok pull request, but i dont expect it to be merged
are you still doing the quantizing?
the what?
import imageminPngquant from 'imagemin-pngquant';
export default async function() {
const files = await imagemin(['minify/*.{jpg,png}'], {
destination: 'minified',
plugins: [
imageminPngquant({
quality: [0.6, 0.8]
})
]
});
console.log(files);
}```
doesnt png use 32bit?
this is the entirety of the script
png also supports 8 bit and 16 bit pixel formats that are indexed, like gifs
and 1bit
i suppose
i just press the magic button and it does everything
i opted for webp, no loss in colors and better compression
i imagine many image programs are not good at quantizing
it can be really complicated
ive got the world map at about 9 megs lossless
9mb?
9mb is really good
yea
does it have a reverse function?
hmm no i ... never imagined id need that
i couldnt find a tiler program, and when i finally found one it would choke on the image size or it took hours and hours
or it was some linux script that had 10 dependencies
i used kastow's math/coords for placing the images in my stitching script tho
kastow figured out all the distances and sizes and placements
yea i think i could do better than 9mb if i didn't use lossless
but this is 32 bit color lossless
basically these couple of lines of text are the reason storm cannons work in this game
the browsers do not load webp very fast tho, png seems to render faster
with these numbers i could figure out the size of everything
the rest is just basic math
its basic math ... if youre a programmer. also times 23 maps
its not basic math for normal people
it uses irrational numbers, kastow!
sqrt 3

dude i went to uni when i was 16
i was busy repeating algebra for the 3rd time 
i almost dropped out several times in the first years of uni due to physics and math
it was harsh
some of the math classes can be back breakers
physics tended to be relatively easy math i thought tho
i still dont know the difference between weak and strong induction (math)
the only thing i remember from the uni math is if you have 0/0 you can find a differential and it will be ok
l hospital rule or something it was called
yea i think thats also american high school math too, weirdly
when we had differential equations my brain just fucking melted like the blood from Alien
through the floor
and never came back
hah yea those were interesting
the third year of uni was much easier
we have a course called discrete math here that is a real brain melter. and also optimization
yo man discrete math is actually useful when writing ifs
sure but it was like 10 different math disciplines crammed together
too big of a scope for a single course, in my opinion
for us discrete math was the first semester of uni where we had shit like A u B ^ C
and linear algebra probably the most important thing in computer science also has way too much content in it
and like things 20x bigger than that
ah in my course boolean algebra was only a small 1 week part of discrete math
where the computer nerds got to take a break because it was easy for us
fuck, i got an old version of the Tempest Island Hex
how they were slightly off?
yes
so basically
when you're drawing region zones on canvas its easy
because you can just clip the image
but with leaflet you can't do that because its polygon coordinates
oh yea... you have to intersect a square and all the polygons of the voronoi, pain in the ass
i had to fucking manually write the spaghetti code to calculate the intersections between the polygon lines and the hex
you can just clip it with a hexxagon poly
heh ... kastow...
you cannot imagine what i did for the roads
i did end up scripting the same thing, where the roads cross borders
gotta make due with a screenshot then
i use gdal command line tools for it
most of the time i was able to get away with nearest point calculations tho
but holy crap, gdal is your friend! seriously. for geospatial scripting its a godsend
@long raft is it used for anything besides marking roads?
no, i just wanted a message that indicated when you were about to cross a region
or do you mean gdal specifically?
gdal specifically
oh its just ... a big library for spatial calculations and format conversions and stuff
also this color palette for the roads can fuck off thank you very much
part of what it can do is shape intersections
Old school maps were great from a view-ability standpoint, too bad they were literally hand drawn. Also LOL @ resource amounts back then
That img will be 2 years old in about 16 days
reminds me of my first two wars - we were just three people, each took a truck, grabbed a sledge and we drove in circles between resources points
i did a route of 3 comp yards (we were techmining)
I miss Dullahans, that was one of my favorite legacy city’s to fight over
Along with Loftmire and Sunhallow
it doesn't compile but the code works typescript just stupid https://github.com/pizzafox/foxhole-ts
@mild kernel mistake here
wrong
teams are as follows: NONE, WARDENS, COLONIALS
hehe
that file should be totally compliant with the api spec
and then i do some (opinionated) transformations which is what your screenshot is
ya
no one here except me uses typescript though lmao
it uses ky-universal which runs on node and browser
so in theory you could make a website or something idk
dont know that either
i use fetch and xhr
ok so here's why i use xhr and no one else does
client connects to the backend via socket
it wants live map updates
and by live i mean within 3 seconds of the event
so every 3 seconds a service makes a request to the api
but we don't want to pull the data if nothing changed
only xhr allows you to check etags on readystate and abort requests
bro websockets exist
rtc
http push
so many modern ways to do this
btw i made docs https://foxhole-ts.netlify.app/
Documentation for foxhole
i just couldn't find any other way
we need to get the info from api in almost real time but we want to save up traffic
you should totally rewrite it to use a proper realtime communication protocol
requires server code though
all i do is write javascript
foxhole war api except openapi 3 https://github.com/pizzafox/foxhole-oas/blob/main/openapi.yml
also with broken autogenerated markdown docs
Me after my code doesn’t work for three hours with no sign of stopping
Id post a selfie with the same captition
Me when you recheck everything and after 3 hours you find out you have been summing up numbers as strings
Me when you ask your project group to to make a simple plate to attach an endstop to and they come to the meeting with cube thats burned, molten and ridden with holes
Me when you ask your project group to come with a rotary encoder and it they code the logic inverse to the point is always true
Me when you ask your project group to make the documentation but one of them doesnt even work and the rest is incompetent
Me when I see C#
This is my problem turtle
Who makes a wirin diagram like that AND puts it in the final document to be graded
@coral sundial light it on fire and start over?
cursed
blursed
Roger roger
read pins
this is our sacred nerd cave
we're gonna have to burn sage and get this place re-blessed now that a non-coder came in
I shall bless it with my Lua buggy code
this code for some reason refuses to return p
satisfied?
At first I thought this was gonna be like Navajo code talk, but this is just as good
apache is quite popular here 😜
@timber onyx c++ has stuff like exceptions, specific casts (reinterpret_cast<int> instead of (int)), classes, inheritance, templates, a completely different runtime and set of libraries
yeah but didnt C++ just start by being C with one extra thing
you can really get yourself into deep trouble with c++, make completely unreadable code with insane operator overloads and stuff
no it really had quite a bit extra, but was backwards compatible
people think theyre doing c++ but theyre really using a lot of the C subset
for example, if you do a C style cast of a variable like
int x = (int)5.0; this is C, not C++
C++ would say you need to use one of the specific 4 cast types
things like exception handling completely changes code flow
i had to really train myself not to use sloppy C techniques
and template are like an entire language themselves, they go deep
C is sloppy? the one time i had to actually work with pure C i felt like i was doing machine language from how specific i had to be
just look at the difference in a hello world program, in c++ the important line is
cout << "test";
which is basically uninterpretable if you dont understand what its doing
like ... do you even know how that works, as a C programmer?
holy shit i dont
they usurped the left shift operator to do something COMPLETELY different
a stream class is the first argument, a string is the second, it returns a stream class
so you can daisy chain them up
so even a hello world program in c++ makes no sense to a beginner
they just follow the example and have no idea what its doing
c# wont even let you do that kind of confusing nonsense
they only let you overload basic math operators
ffs in c++ you can overload the equals (assign) operator
can you imagine how confusing your code becomes if equals doesnt mean equals anymore??
good god C++ is a huge language
the compilers for them are so much more sophisticated than C
when java and c# were designed they were like holy shit remove that noise
so who is C++ made for
i mean it can do pretty much anything C can
but you can hurt yourself with it
its a real power tool
analogous to a planer
easy way to lose a finger...
C code is verbose, but very readable.
and c# is basically java done right
lmao
im generally able to take C code and convert it to c# without much issue, sometimes theres some tricky stuff
i cant say the same for c++
alright so i guess im a C fan
i feel every pc programmer should know C and javascript
i will probably need to add python to that list in a decade
what languages were you expected to learn or be exposed to disk?
mainly C with extra steps
no exotic languages?
but since everything uses javascript i gotta learn how to interact with it
whats an exotic language to you
i think my courses included C, c++, Java, Javascript, PHP, lisp (clisp or haskel), prolog, various assemblies
i think something outside the imperative languages are exotic, like F# or lisp or prolog
i deeply hated prolog
well like i've told you i work mainly with hardware interface
yea my schooling is definitely more on the software side, but i feel like i got a lot of hardware stuff
and im pretty sure the language that's best for simple short limited memory stuff is C
yeah, or assembly
yea most popular languages let you do some sort of inline assembly
generally not recommended
how come?
yeah it does require a lot of remembering what is what
a lot of optimizations are not intuitive
as a quick example, when i was young, everybody did xor ax, ax to set ax to 0
instead of mov ax, 0
because it was faster...
how are you supposed to know that shit
lmao
and now its totally irrelevant
makes me think of specifying your int type
int as in integer or interrupt?
integer
like instead of putting int on everything you do that doesnt require float you actually use short, long, unsigned
oh
yah float is slow
i mean ... float is for saving space, in fact
if you dont care about space use double
i like how arduino does its data types
hows that?
if you want an unsigned 8 bit integer you just type uint8_t
pretty simple
in fact i like arduino a lot
makes everything easy
actually wait now that i look it up uint8_t isnt specifically for arduino
i mean thats ... pretty generic
hungarian notation
ubyte would be the same thing, no?
god you can tell i havent coded in a while
its a custom definition, like ...
#define uint8_t unsigned byte
i personally like to use the reserved keywords in the language for my variables, i find it more readable than hungarian notation
meh, that's how my teachers do it so i do it the same
i like to take things apart
actually i guess thats not ... specifically hungarian notation
but in a lot of C code you see typedefs used to make new primitives, ive always hated it
they do it for portability
its not really ... defining it like a struct
its more just renaming it, or making another name for it
ah
have you seen union?
where you can have 2 names for the same value
so you can treat the same variable as an int or a float
yeah i guess it would be pretty catastrophic if you could accidentally increase the value of an integer by 1 and you suddenly overload your computer
also no i dont think i have seen union
but that sounds pretty damn useful
as in making C# work with other code or just straight up rewritting a different language?
in general im doing it with c# but yea, outside of c++ you cant get support for union
you just have to use pointers or other tricks
i think its a weird functionality to have
C programmers abuse it to minimize space, they can avoid having 2 variables sometimes
also i just learned that arduino IDE is made in java
seems funny to write something in java that's made to work with C/C++
it takes so much longer to write something in c/c++ and keep it up to date and avoid bugs
it really feels like using nails instead of screws
off the rails slot machine
gives drivers something to do while they deliver goods
yo dawg, I heard you like gaming, so I made a game to play while you game
Does anyone here know how to sample a sine wave and get 8 bit values?
I am trying to create a sine wave for a buzzer
The only thing I have so far is a pwm signal
Create array, span a sine wave, multiply values to 2⁸, set to integer, cry because it is prolly broken and I have no idea what your set-up is
But to serioisly anser your question: there are many methods and packages in every programming language to turn to bit editors. You can then sample a standard sinewave using a math funtion by gradually chancing the angle every step, convert the value directly into an 8bit signal, and send it on its way
owo
Hey, has anyone create a python (or other) module to wrap the war API?
@rare crow someone here did a while ago
Most of us have been working with the api for like 2.5 years so we know how it works, but there is a module yes
I think it's in js
Cool I'll do a python wrapper anyway as I can't find one
you can use my openapi 3 spec (https://github.com/pizzafox/foxhole-oas) to generate a python library (several options available here https://openapi-generator.tech/)
here is this remotely usable
Yeah that's useful, thanks!
For the feed, am I right in thinking you just cache the map data and poll for changes?
mfw I have been looking at my serial plotter for hours. asking myself why it doesnt plot a sine wave
mfw I realize the sine wave its plotting isnt continious
I copied faulty code from the interwebs 😠
That looks alot more like static noise
As opposed to this junk
did you implement your own sin function or something?
I implemented a DDS
with sine lookup table
initially copied from my book. but it did a weird thing where the table wasnt continious in 0. but mirrored on the vertical axis
do you just have to modulo x by 2pi?
no its a lookup table
how is a table supposed to be continuous?
well if its table that supposed to have a full sine wave stored in it. and its mirrored vertically around 0. it isnt a continious function
you can see it in the first picture. to the left.
is it too slow to use a taylor series to generate sin values on the fly?
mmh. I dont think thats pretty math heavy as well.
I totally did not fail my math test about derivatives
its not calculus, but yea it has a lot of division ...
According to my book. I am already pushing the hardware quite far
yea wasnt sure how strong the hardware was
is that the modem tone?
what
you dont know what dial tone is?
is it called something else abroad?
its the hum when you pick up a landline phone
i think its an A + G notes
an arpegio ...
Well ive got a hum
i wonder if they are different frequencies in other countries 
sure looks right - can you hear it?
and dial tone doesnt immediately fill you with feelings?
I am 22 and a social leave me alone
maybe test it with just 440hz then, until that sounds like an A
maybe you have to divide by 2pi =p
{
OCR2B = (mixer + 128)>>1;
DDS1.accumulator += DDS1.accumulator_steps;
DDS1.step = (DDS1.accumulator >>8);
DDS1.pwmvalue = sine_wave[DDS1.step];
DDS2.accumulator += DDS2.accumulator_steps;
DDS2.step = (DDS2.accumulator >>8);
DDS2.pwmvalue = sine_wave[DDS2.step];
mixer = (DDS1.pwmvalue + DDS2.pwmvalue) >> 1;
}```
like dds1.accumulator * 2pi maybe
I only have 2 values I can adjust. the mixer and accumulator step
and the accumulator is 440 and 350 respectivly
hmm
but I can try
like how do you translate frequency to the accumulator value ...
im guessing it goes 0-1 but really represents 0-pi
/ 256? so ... its 0-256 range?
yes
can it ever be 256?
ah thats why its continuous, never gets to 1.0
soo ... sometimes the frequency is not just ... a number
like 440
0x80, 0x83, 0x86, 0x89, 0x8C, 0x90, 0x93, 0x96,
0x99, 0x9C, 0x9F, 0xA2, 0xA5, 0xA8, 0xAB, 0xAE,
0xB1, 0xB3, 0xB6, 0xB9, 0xBC, 0xBF, 0xC1, 0xC4,
0xC7, 0xC9, 0xCC, 0xCE, 0xD1, 0xD3, 0xD5, 0xD8,
0xDA, 0xDC, 0xDE, 0xE0, 0xE2, 0xE4, 0xE6, 0xE8,
0xEA, 0xEB, 0xED, 0xEF, 0xF0, 0xF1, 0xF3, 0xF4,
0xF5, 0xF6, 0xF8, 0xF9, 0xFA, 0xFA, 0xFB, 0xFC,
0xFD, 0xFD, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFE, 0xFD,
0xFD, 0xFC, 0xFB, 0xFA, 0xFA, 0xF9, 0xF8, 0xF6,
0xF5, 0xF4, 0xF3, 0xF1, 0xF0, 0xEF, 0xED, 0xEB,
0xEA, 0xE8, 0xE6, 0xE4, 0xE2, 0xE0, 0xDE, 0xDC,
0xDA, 0xD8, 0xD5, 0xD3, 0xD1, 0xCE, 0xCC, 0xC9,
0xC7, 0xC4, 0xC1, 0xBF, 0xBC, 0xB9, 0xB6, 0xB3,
0xB1, 0xAE, 0xAB, 0xA8, 0xA5, 0xA2, 0x9F, 0x9C,
0x99, 0x96, 0x93, 0x90, 0x8C, 0x89, 0x86, 0x83,
0x80, 0x7D, 0x7A, 0x77, 0x74, 0x70, 0x6D, 0x6A,
0x67, 0x64, 0x61, 0x5E, 0x5B, 0x58, 0x55, 0x52,
0x4F, 0x4D, 0x4A, 0x47, 0x44, 0x41, 0x3F, 0x3C,
0x39, 0x37, 0x34, 0x32, 0x2F, 0x2D, 0x2B, 0x28,
0x26, 0x24, 0x22, 0x20, 0x1E, 0x1C, 0x1A, 0x18,
0x16, 0x15, 0x13, 0x11, 0x10, 0x0F, 0x0D, 0x0C,
0x0B, 0x0A, 0x08, 0x07, 0x06, 0x06, 0x05, 0x04,
0x03, 0x03, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03,
0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 0x08, 0x0A,
0x0B, 0x0C, 0x0D, 0x0F, 0x10, 0x11, 0x13, 0x15,
0x16, 0x18, 0x1A, 0x1C, 0x1E, 0x20, 0x22, 0x24,
0x26, 0x28, 0x2B, 0x2D, 0x2F, 0x32, 0x34, 0x37,
0x39, 0x3C, 0x3F, 0x41, 0x44, 0x47, 0x4A, 0x4D,
0x4F, 0x52, 0x55, 0x58, 0x5B, 0x5E, 0x61, 0x64,
0x67, 0x6A, 0x6D, 0x70, 0x74, 0x77, 0x7A, 0x7D
}; ```
its the ratio of frequency to sample rate
so if your frequency is 22050 and your sample rate is 41000 then maybe its a value of .5 (or 128)
because the frequency is always relative to the sample rate
wait how did you deduce that out of my code?
its a guess
because I am relatively sure m is the accumulator but I have no clue to be honest
ive done audio stuff
I am quite happy it works
like when it comes to filters, theres a frequency cutoff, its always a floating point between 0-1, relative to the sample rate
and it should never be more than .5 because thats ... distorted otherwise
nyquist frequency and whatnot
no dyno is just lame
440 * 16000000 / 256 = 27500000
what is your sample rate?
how many samples are you spitting out per second?
i see 9600 as custom bitrate?
i assume that means 1200 sample rate? because 8 bits per byte, and your samples are 1 byte?
frequency should be 0-.5, not some huge number i would think
i really dont know how the accumulator works tho
if your sample rate is 1200, then i would expect frequency to be 256*(440/1200) / 256
just no idea how it works tho
A really low accumulator results in a very slow ticking noise though
i would assume in your case the frequency is a byte value between 0 and 128
if you set it to 128, and your sample rate really is 1200, then youd hear a tone about 600hz
or set it to 94 to get 440hz roughly
not very precise tho
well you have to consider how fast my pwm signal gets updated.
that is on the overflow vector. my overflow vector gets triggered roughly every 0.000016 seconds
could it be a 62500 sample rate?
so every time that happens. the next value is loaded in. and the accumalator advances a cycle
is that alot?
nah
i mean its not a lot for audio, maybe for other signal types its a lot
probably without a filter even
phones have a sample rate of maybe ... 11000 or so, that allows them to play frequencies 0-5500
the max frequency you can play is 1/2 the sample rate
Yes. but ive yet to figure out how to produce an actual sound with it
other than noise 1 plus noise 2 xD
yah gotta figure out how to specify the frequency
well according to the formula I posted earlier. it would be simply a matter of changing it to take requested frequency as a formula. and output an accumulator value.
frequecy of the CPU
so (freq / Fcpu) * 256 where (freq/Fcpu) is 0-1 value
yes, problem is I am working with integers only
right
so maybe it really is the raw frequency value then
so when you put freq = 440 you should hear https://www.youtube.com/watch?v=xGXYFJmvIvk
The 440 tone is A in the musical scale. This tone is good for tuning or keeping a reference to A. The Sine wave has no overtones so it is sometime called pure as it is only the fundamental frequency.
The creation process involved a DAW (digital audio workstation), ProTools. A audio signal generator was utilized to create a sine wave and the f...
values lower than 1 would result in dividing the output frequency
thats the same noise my phone makes. but my arduino makes a completly different noise
I wonder what happens if I do fill in a small value
I am not sure wether it will cut off the value and multiply by 0
ah
it just breaks
just frequency 0 (from rounding integers) probably yields nothing
but 440 works? and it plays a tone?
yes
everything above 1 plays a tone
and it scales as well. 1 is low frequency low pitch tone. and larger values produce higher frequences and tones
but its not playing the 440 hz tone correctly?
how does it look visually?
you want the datasheet?
yah kind of curious if it looks like a 440 hz sin wave
i find myself wondering, maybe it needs to be scaled by PI
maybe its roughly 3 times lower frequency than expected
or what if the sin table is in degrees not radians
easy tests, multiple the frequency by 3, then try multiplying it by 180
see if either one gets closer
hmm
so maybe the sin table was calculated in radians then
i dunno how youd multiply it by pi when youre dealing with integers
multiply by 22 divide by 7 i guess?
3 is also pretty high but more louder
it doesnt produce a nice a sound
it really does sound like the right frequency but the pitch is all wrong
its way higher than you hear in the video
louder? wow
its clipping then
its makign the value larger than 255 and its cutting it off
by book tells me at an f_cpu of 8mhz, an accumulator of 880 is roughly 440hz
I run at double the speed of that
does it work when you test with 880? interesting.
holy crap
there is something wrong
yeah
I can add a prescaler to the timer
divide it by 8
or doubles of that
I made a fire alarm lmao
oh that just makes it sound higher
I have frequency generator on my phone. and it sounds weird but I do get the idea that its on the same frequency. but the tune is way higher
it shouldnt be higher if its the same frequency
I mean, hop on voice and maybe you can judge the sound better than me
I am tone deaf xD
oh its filtering out the noise
noooo
ive got no mic hooked up
you only need to listen
but if it doesnt sound the same to you its ... for sure not
I think its filtering out the noise
ok i can hear
hear anuthing?
its not really playing across well
filtered maybe, i dunno
some light chirps is all
lol buzz noises
yea thats ... thats not right
my guess is its way higher frequency
yeah. well according to the formula it is something like 22khz
like higher than the sample rate, so its getting decimated
it shouldnt buzz
it has an insanely high sample rate tho
if its really 8mhz
usually audio sample rates are in the khz
does it generate the sin lookup table when it starts? or is it pre programmed?
pre programmed
yes
but its pretty heavy for a microcontroller
all standard math.h functions are available
I have code that barks dogs
The following I have deduced
there is a sample timer updating the registers
instead of it running on PWM timer
this might work way better
the register that updates the buzzer signal is always update at the start of a pwm phase
if I update the register at a sample rate
which can be defined with another timer
if it were me, id run a test using C's sin function just to make sure where the problem was, to make sure the hardware can output the 440hz tone
still not a sin wave
what does it mean when a programmer does #define sample_rate 8000UL
specifically the UL
i mean i ... i guess it could be... maybe
its weird the peaks arent present, it makes me think the sample rate is too low for this frequency
that looks ....a lot closer
its still scrambled
yah it looks like several signals
I have the feeling the serial port is interfering
but I Cant figure out how becuase the signal doesnt improve when its commented out
and the graph worsens when I communicate faster
what are the things that can cause interferance? ive got a wireless mouse nearby
a speak thats has power but not plugged in
and a phone
what why how
I keep increasing the sample rate by a factor of 10
heh it seems like you need a better example of how to do sin that is easier to use
I am going to download the barking dogs demo
see if it works
I am starting to think either my arduino is broken or the board is flawed
fuck you dino
I am going to wire up my own buzzer tommorow
god
What I see here is that sometimes, the signal jumps
Like it sometimes looks like at random sometimes data gets multiplied by -1
If you look on the left, you see that the first rising wall is most likely only one datapoint change
Very interestting
if you think your device is broken, try with actual sin function
i suspect its the algorithm
because visually its wrong too...
@long raft
do you know any other event logs active than mine ?
some peeps reporting missing flips but not sure if problem my end or api end
uhhh ... is ... is there a bot kastow makes that logs events?
i dont know that anyone is logging it tho
@zealous sonnet
Do you guys keep an event log history anywhere ?
even just internally
as there have been several reports of events either not being reported by the API or by my site/system, and im trying to work out which is at fault
@zealous sonnet ok , it seems @barren quarry does so i will comprae with him first
so yeah @zealous sonnet it would seem possibly the api did not update/change correctly
@barren quarry confirmed there was no event in his log for wardens taking this town in question, which a player sayes was held by wardens for about 10mins
skelter in ob
day 270
also Viper Pit and Reaching Trail have been experiencing temporal anomalies recently:
@exotic steppe thanks
yw
if I wanted wierd time stuff in an online game thats why I play Star Trek Online
lel
In case this helps anyone, a python wrapper for the war API I'm putting together: https://github.com/JonnyPtn/foxholewar
using it for a discord bot
Also adding tests as I go along, so can be used for continuous testing of the API
@pure sierra I'll be sticking the data into a database for an event log so in future could be used to cross-check against yours. Out of curiousity how often do you poll? I see the dynamic map data can update every 3 seconds so that seems like a reasonable interval?
report data says it may update every 3 seconds by as far as I can tell it only changes every ~10 mins?
e.g. for last hour:
I have a cron running every minute to pull new stats. did i just miss one do you guys have the same hole? Version 190/191 are missing...
@zealous sonnet please oh please can we get weather data in the warapi
that'd be awesome, but I can't see it ever happening for this update, we're simply too busy
understandable
f

I have no idea whether the stuff near the top is supposed to be an error or just a debug
a whole host of stuff I've not encountered in the editor
which is weird cause i see collection was modified
so youre editing a collection while you loop on it
this is a no-no
easy to fix by putting a .ToList() in your foreach
you say easy, but I get the feeling that'll just fuck it up more
I'll certainly try, the internet sure as shit isn't being helpful
I fixed that one already
i suspect you have a pattern that looks like...
foreach(var x in Y)
if(...)
Y.Remove(x);
item with the same key ... thats a dictionary adding the same item twice
maybe this is just ... something related to where your content is loaded from, like a path problem
or resources that arent being included in your build
what are the lines around API.cs:457?
a mess, I'd imagine 
looking back, it's a lot of quick n dirty
lol has the code changed since build? why does the stacktrace report a line thats blank?
it's true I have a whole bunch of for eaches
But what I find mysterious is why these errors are not coming up in the editor
when I run the whole thing, anyway
Haven't really touched any of this after I got the API to draw the laebls and icons on the map for me
its ok to modify a collection that you are not looping on
thats why .ToList() is a nice trick because it makes a copy of the collection
actually i dunno if it makes a list copy if its already a list
.ToArray() always works too
or you can build a separate list of records to add/delete
you know my guess is that getDynamicP.mapItems is an empty array
so mapItems[0] is crashing it
any way you can verify the content in DPinfo in the version outside the editor?
i suspect its blank
maybe?
my guess is youre trying to query an empty region?
Considering not all regions are being used right now, that's entirely possible
if(getDynamicP.mapItems!=null && getDynamicP.mapItems.Count()>0)
foreach(var i in getDynamicP.mapItems)
...
should be an easy trial run
it doesn't break the editor playtest at least
still there
I'll try the ToList tomorrow
It's getting late, or rather, early
What's interesting is that the API still works exactly like in the editor
No missing names or icons at first glance
other than the UI being out of whack, but I pretty much expected that to be the case
you were expecting it to fail outside the editor? im confused
..._.....-..... . .
@long raft So I got around to adding ToList to every single foreach loop, and it seems like all the errors in the console are gone
so thanks for that :)
Glad it worked
lol

tfw you accidentally make third person
...how
Technically not a massive problem, as said cylinder should be turned off when you use the map
When I do tackle this problem I should check if it doesn't secretly move when turned off. Don't want to go sleepwalking when you use the map
10/10 would not recommend freezing my work laptop for 13 minutes for shits and giggles
Hmm I've got a dell with 1.5TB ram that probably wouldn't even gag
Maybe with compression I could find that much storage on a machine oof
now the player stays in place when you use the map

wtf my goodness

Colonial and warden forces in disarray after sudden blizzard hits
Also have a fancy new bug which might just be specific to the editor
@summer bobcat tank warfare after the colonials get the falchion be like
yooo nice models man
you gotta thank @glad whale for those
He offered to make more, but that's the second to last step with this project
I can't get past the 
Don't let the bed bugs bite
Dont the foxhole player models come in t pose?
they do, but I don't have those
Well, I've got something of a working build, but unsure on how or where to share it
I dunno, a google drive link could work, but am I allowed to post it in this server?
Yes i think sir pinned something like that?
Okay, so here goes. I'm sharing what I assume is a playable version. This link should let you download the folder called 'Run1' (I know, creative). I assume you need the whole folder, and if you run the exe in the folder it should work.
https://drive.google.com/drive/folders/1okWpZE1x5XAWlfcQt_H9QKDTc5P9GCJI?usp=sharing
A few notes:
- The resolution is locked at a windowed 1280x720, so those with a 1080p monitor like normal people are gonna have a smaller window.
- There is no saving. Anything placed down will be gone when you close and relaunch it.
- I shouldn't have to tell you it's gonna be buggy and not work like you want it to. It might even flat out break, though it's been working for me so far.
- I'm sharing it as-is. It's for those interested to play around with.
@keen wedge
I don't have a video to showcase what you can do.
Do I post a comment link in #foxhole-creative or what?
make a zip file
its way too many files and folders to individually download with drive
that FOV is pretty intense, timber
i feel like i would like it wider
sorry uhh the opposite
narrower
have you tried building the webasm version yet?
yah the map looks wide the room looks like a long hallway
its not the resolution or the aspect ratio, its the camera's field of view, its really wide
80 isn't wide
they have a webgl compilation that will compile to web assembly
and run in the browser
yea 80 seems very wide to me
to me, anything less than 80 feels like having binocs strapped to your face all the time
seeing the world through a peephole
it should be like 60...
oof, at 60 I'd actually trip over stuff if I could
60 is pretty normal for games
people raise it higher because they want to see peripherally more
but it does give a warped feeling compared to what a normal view would look like in real life
for example, human fov is maybe ... 135? but if youre looking through a screen that would be like a third of your FOV
at 60 I can barely see ahead of me as it is
Humans have a 120 degree FOV
right but your screen does not take up your entire FOV
and you are essentially looking through the screen like a window
and that window is too tiny to actually see anything most of the time
Yes, but if that window is on a small FOV it feels like you're in a tunnel
Looks good to me
guess for the next demo, if I remember to write it down that is, I'll add a slider or something for people to fix it themselves
did you run it?
Yes
so im just crazy?
though what's the benefit of running this in browser
no downloading it, no need for running binaries on my computer or virus scans
runs on all architectures
so i could theoretically open it on my phone
I guess? Though I'd need to check if that does multiplayer as well
theres ... websockets
Yea, my antivirus just got annoyed at your program
.dll files from an unsigned source make it unhappy
the build settings does have a WebGL option, so I'll see what that does
though don't you have to host those somewhere?
🤔 been too long since I last actually used github for real, though I did make a repo already
well you can set "github pages" in the settings to a specific branch (or primary/master) and it will automatically host the files on a website
and you can even redirect a domain name to it
thats how im hosting logiwaze.com
used to need their special unity web player before they added the webgl build
followed the steps and all I get is a 404
Note: It can take up to 20 minutes for changes to your site to publish after you push the changes to GitHub.
ok
its a little tricky yea it takes a minute
cant complain about free high quality hosting tho
timber are you planning on making a game server for this?
@long raft eyy, it works now. Also probably, if I want multiplayer, which is pretty much the whole point of this endeavor. I haven't looked at how yet, but dedicated is not going to be it.
https://realtimericky.github.io/
though it looks stuck loading the last 10%
hard to do a server without being dedicated, no?
im getting 404 error
you need to set it up to default to index.html
yeah, I'm trying a different build to see if that one doesn't hang on 90%
it did for me
maybe ctrl f5 your browser, i dunno
Yeah, this one works

