#code-talk
2 messages · Page 4 of 1
i dunno, i tested your code with the 4 tests, they come out right for me, any idea which test is failing for you?
None. All I know about this is that it must return 12933. Nothing else. It don't say what argument it transmits
I correctly called the transmit of the argument to the function? I have never read books about programming in English :)
well for the example tests your code works perfectly
you would have to determine exactly which input values are coming out wrong
test #31 i guess
before the return -1 you could do:
print("Error:")
print(n)
print(p)
return -1
or print it out on one line
i dunno, it would be the last error you see listed, i think
It returns -1 with (10383, 11), and... I don't know too
is that the test that failed?
some are supposed to be -1
Nice
🦀 🦀 🦀 🦀 🦀
?warden
git: 'gud' is not a git command. See 'git --help'.
```
oof
@kind glacier https://www.youtube.com/watch?v=9Deg7VrpHbM
Template for putting down groups such as: -furries -bronies -rednecks -weeaboos -and many more Source: https://www.youtube.com/watch?v=EdstMCqTJw8
"git" some help
k0d t0lk
plug walk
Anyone got an idea how to make a simple timed bomb in an application supposedly like bomberman?(I'm using glut and opengl),I've got the effects down, i.e making the areas around the explosion turn to walkable space but it happens in an instant
🤔 a bomb timer eh?
yup

here's some code(don't try to run it glut and some shit is needed) https://pastebin.com/p88Qqnfx
what about just adding a wait x ticks function
a linked list to store the bomb data (where it was set, when it was set), then check to see if any bombs should be triggered on each cycle
can presort the list by activation time for better performance, can skip most of the list each time
is it real time or turn based?
Is the war api being updated for the new map by next update?
@quick shoal
why do you of all people care, you also have some war api based stuff?
No just wanted to know if it would be updated wanted to get creative this summer
Here's an idea - I will likely host war map on GitHub and open it up for contributions, you can fork a branch and make changes and then submit a merge request. Kastow and I will check it and add it into the war map if it is working.
sounds like a good idea
no that everythings a bit more above board , re no steam api, ive thought of publishing some functions for common things one might want to do in php
@young pilot Sounds good sorry don’t have notifications for this channel on so didn’t see the response from yesterday, I’ll try to help with the git as much as I can

ugh, should I just switch to BTRFS?
var dict = {};
var start = Math.max(0, arr.length-20);
for(var i=start;i<arr.length;i++)
dict[(i-start)] = arr[i];
something like that?
ok nvm i figured it out
is that what you mean by map tho? like a dictionary?
@barren quarry, а в чем проблема? Джаваскрипт не знаю, но алгоритм, что называется, на пальцах: пихаешь в целочисленную переменную длинну массива(пусть будет n), пробегаешь арифметическим циклом по каждому элементу от n-21 до n-1, применяя нужную функцию и пихая во второй массив. Собственно, все. Sorry, English-speaking people, I speak English a little bit
да я собственно так и сделал
😛
@barren quarry just do a foreach
http://foxholestats.com/ is getting event log multi-language support 😃
using defines and constants in php
se the event action is stored such as cosntant CONSTRUCTION
then i define variation on that constant such as define("ES_CONSTRUCTION", "En Construcción");
then get the language selected eg ES , concenate the 2 with a _ to get ES_CONSTRUCTION and then load it with contant() function in php
anyway im off to bed, if anyone want to do a translation dm me, and ill send you the deets
hahahaha, nice
good night, sleep tight, dont let the computer bed bugs bite @pure sierra
@pure sierra i can help with russian
@barren quarry sent
so im expanding my website with Mulon, and he asked me to do a seemingly simple thing - make a nested context menu on the map that allows people to choose icons from a category. What could go wrong, i thought?
so this is how the context menu usually works
when a map is declared, you also declare a context menu with all its options and items
there are items in the context menu, and when you click on them, some function is called
so at first i thought maybe i could declare context menu in a context item like i declared it in the map
well this didnt work at all
then i went to the plugins github
ok, this was disappointing
i thought about it for a bit and then i noticed that it puts the context menu item text inside the context menu div on the map as straight html
so i thought, aha, i should declare dropdown with buttons inside this html and write the event names as string in there
well the dropdown part worked
the event part didnt
then i realized that i could declare a div with an id in the context menu, and then when the object mounts (this is react), i then add the buttons in the context menu via react into the id
this also worked
but when i tried to add events to these buttons, they didnt work
no matter what i did, when any part of the context menu item was clicked, it called the same callback function
because technically the dropdown button and the dropdown itself are the same object for the context menu, and when i click any of it i do the same thing
i looked around the plugin source code thinking how could i fix it
and i found this
basically, it is told to ignore any click, mouse press, double click and rightclick events happening inside the item
and give callback instead
so there are multiple buttons in a dropdown and i have to give a unique event to each one
but the plugin straight up says no
it took me a while to figure this out
so here is a riddle for you guys, there is a context menu with a button that should open the dropdown,
the task is to make the dropdown open and only open, and then if a button is clicked, call a function unique to that button
considering that the plugin ignores any click events when you declare them inside the buttons
(i figured this out already so no rush)
https://cdn.discordapp.com/attachments/523401134107525121/580863009409466379/unknown.png and this is what it looks like
the context menu plugin counts this whole thing as one item
so the context menu plugin lets you do the filtering ? and you are trying to put a fly-out dropdown menu inside it ?
not filtering, another event but it doesnt matter
yes
im trying to put a dropdown menu inside it
and interacting with the dropdown is firing the parent 'filter' event before you have made your final selection ?
yes
thats glitch
can you unbind or not bind to begin with the contect menu event ? or attach it to the children inside the dropdown intead ? what does the context men event do ?
the context menu event does whatever you tell it to do
it triggers whenever you click on the button that open the dropdown or anything inside the dropdown itself
so its all in the same html container
and when you click anywhere in that container, the same context menu event is triggered
well just have it do nothing ?
ie dont use it
(the centext menu event)
and bind differrent events to the dropdown children
the context menu event is used to create the icons on the map where the context menu was opened
so the event, when it is called carries in itself the coordinates of the point at which the context menu was opened
anyway
here is what i did
first of all, when the dropdown menu is closed and the event is called, open the dropdown and do nothing
thats simple
but then it gets interesting
binding the click events to the buttons doesnt work because the plugin blocks these events
so instead i introduce a variable that stores the button index
when your mouse hovers into the button, the variable is set to button's index
when it hovers out it sets to 0
when the context menu event is called and the hover index is not 0, send the event and coordinates to create an icon
this bullshit took like 5 days of my life
oh , ok i thought it was a toolbar, but your solution is not bad, you could instead use the context menu event to write the coords into each child button as data attribute and then read it back out by child button click event
our discord bot has had an overhaul including translations:
Good job
we got colors now !
I've been learning C
congrats'
i always found C to be more like unlearning other languages
i learned c++ first so learning C was just stripping off everything convenient
its like taking a time machine back into 1970
#include <stdio.h>
cout << 'hello world'
int main() {
printf("Hello world");
return 0;
} ```
ok so now i need a real advice
we store a datetime
many users can have access to this same datetime while working on the same page
if the datetime is bigger than the current date, there is a timer that updates every second and displays how much time is left
if, on the other hand, the current date is bigger, it displays the timer is completed
the task in question is to generate one and only one event regardless of users' presence on the server when the timer has expired
i.e. the current time crosses the time in the variable
where is your int main(char ** args)?
🙄
skipped.
i forgot, do c programs have to always return something?
you need an atomic function, kastow
or a semaphor, which is tricky in a database
you can also just use transactions if its stored in a database, begin and end
function of time
so like:
begin transaction;
select time from `table` where blah blah...;
<code here>
update `table` set time="newtime" where blah blah...;
end transaction;
no other table writes/reads can interrupt that transaction
also, yes, C programs are supposed to return an int, thats standard
compilers may complain about that
void main( is not really acceptable
@barren quarry or more simply just put a function server side that checks the timer gap b4 anything else that relies on it happens. and then set client side functions that periodically sync the client map timer with the server one.
@barren quarry hey also, have you thought much about the big update coming out ? bit of work ahead of us ...
@pure sierra yes i have
every day i think about it
So basically I have been making an update for my website since late March and now I have to wait until we know what new features are in so i can adapt the website to the new update
just a map api/framework
OpenLayers is basically leaflet on steroids
@barren quarry how come none of your towns have names ?
The code behind the map is ancient
sethfire is too lazy to update it
Technically i can update it because i have this technology in my website
but im lazy too because, again, im busy updating my website
it would be nice to see some screenshots of the site b4 having to auth
I asked mark about 0.26 and the api map image assets:
"Currently its individual, but some things might change there in our process. So unsure yet where things will fall
we are keeping warapi in mind though"
Ever since I moved the map to the new map , it has broke every single naming system because the coordinates are outdated ....
Either I manually find the coordinates of every single town or work on that naming algorithim
Both require a significant amount of effort
naming algorithm?
@long raft the towns are marked like any other icons on the map and the only thing that makes them different is icontype 5 (t1), 6 (t2) or 7 (t3)
and these icons dont store town names in themselves
so like a table of icon types matches the town name?
instead, you have to pull the array of map labels and find the one closest to this icon
oh
the map labels are stored separately
assuming theyre the same town names, right?
for example
this is static data, and part of it is text labels
you can put them on the map wherever you want
they are not necessarily all town locations
and then you have dynamic data that changes over the course of the conquest
so what we do first is scan for every town with id's 4-7
where 4 is port base, and 5-7 are town halls
add them into a separate array
then for every town we scan through the labels and calculate the distances between each town and all of the labels
then we sort the labels by distance to the town icon
and take the first one
and now we matched a town name to the town icon
the game itself essentially does the same
@long raft
a town-id would make a big difference lol
Yea I would hold off on any sort map related efforts till they get the new map changes done.
I setup the name matching code on the foxhole map. It basically compared coordinates of icons/towns to those in the list of labels that people had compiled. The label closest to an icon was assigned to it.
To add/modify labels we could plot the unnamed icons first. Then click on the map to find the coordinates, then write/modify a label entry. This is time consuming, but a sure fire way to get everything working.
e
I would use an array instead of a switch
It doesnt matter, it is gone now 🦀
This my first time using leaflet library, is anybody know why is the image is repeating?
I have no experience with leaflet, but did you use for determining the size use a length or a scaling? @foggy verge
Because if you gave a size, it is quite common it will just repeat the instance (usefull for creating larger picture while using minimal storage)
If this is a scaling ussie, this can give some trouble with oversizing too much, so scaling it to (length you want)/(length of picture) should do the trick
@foggy verge share your leaflet code
Hm
We had to use leaflet with our last project
Though I didn't touch the leaflet part myself
ok so your mistake is tileLayer
tileLayer is used for google maps where the map is cut into many pieces that appear at different zoom levels
Yeah
so what you need to do is to get dimensions of your image
then?
crs: L.CRS.Simple,
minZoom: -0.75,
maxZoom: 4,
zoomDelta: 0.25,
zoomSnap: 0.25,
maxBounds: [
[0,0],
[1547,2750]
],
maxBoundsViscosity: 1.0}```
ok thanks
var bounds = [[0,0], [1547,2750]];
//Map Image
var image = L.imageOverlay('https://cdn.glitch.com/8b104918-ef75-43df-93fd-45bdd966f7e8%2Fmap5.jpg?1552474465343', bounds).addTo(map);
map.fitBounds(bounds);```
then something like this
the critical part here is L.CRS.Simple that allows you to use normal images as background
hi
What API does Foxhole use?
DirectX or OpenGL
Anyone know that ?
i think directx
anyone here doing advanced c++ ? 😄
Advanced? Do you want a senior C++ developer?
used to be a c++ wiz before c++ 11 came out...
I used to be a programmer just like you, but then I took an update to the knee
lol
I am learning with c++11
I need someone to help me in the FoxholeArtillery in the future.
need someone know Directx, Directx Hooking etc
something like this
https://github.com/hiitiger/gelectron/tree/master/game-overlay
check n_overlay and n_ovhelper
I can use this code right now. but If there is someone who can help update it, it will be very good
Working with unity, and github won't recognize script associations :/
What's that overlay for?
It looks good.
For the first version of this app we will support only bordless fullscreen windows
I have to work on overlay 
have you done much DX programming?
it sure is ... fun ... ahem
really theres nothing thats ever been more fun than COM interfaces, good job microsoft

If you just want to implement an overlay, some minor change to the existing code is enough. I don't think modifing existing code requires much effort or experience.
The underlying hooking and code injection jobs are all done.
it wont work on fullscreen?
just getting a c++ project to compile is like 75% of the work
so basically i need to make this work somehow
and this is really weird
the other ones work as intended but not 16&10
16 is 10000 and 10 is 01010, & is bit-wise and , so 0 is the right answer
@barren quarry hayden Today at 11:40 AM
i would answer but im muted
the mistake hes making is that the 16 is decimal not hex
and the mask is hex
it should be 0x10 & 0x10
haha drunkle the programmer medium
gib double FA range
why no activated windows?
@raven igloo °
huh?
why not?
idk windows errors
ive got a trick for ya then
what
unplug ethernet, try to activate - there will be an option to activate by phone
phone activation works
also lets you enter a new activation code if maybe you didnt set it
let me check
i have to activate my windows by phone most of the time
it takes about 5 minutes to read off all the numbers and crap but ... yea it works
did you unplug the network?
yes
it wont give you the phone option while it has an internet connection
hmm
activation server ... like its setup to connect to windows server to get activated
does it give you the option if you type "slui.exe 4" into the command line?
that runs the activation program (i think setup for phone)
i did have to reset the activation code once with
slmgr.vbs -ipk <code here>
but that was on server, not desktop windows...
@raven igloo
thank you
Wait to see it in the Action 😛
looks nice
but you should add a toggle that makes it minimalistic
so not as much screen space is used
it would take like a quarter of the space it takes right now
something inbetween those two
where you can still enter all the data
but it takes minimum amount of space
hmm
coding
this place seem inactive i go now BYE i hope i wan't anoying
oh
sorry
HI
what that toggle thing?
what ? 😄
this thing
this is a toggle btn from Artillery calcultor
the calculator is community-made
oh
how i do that?
i never got into spotting for arty due to bino not have far range then have to do math to get good fireing parttens
This software is not hard
you can put enemy and friendly coords in app and get enemy coords
like bino but with more range
And you do not have to stand next to artillery.
okay THX @raven igloo
where does one obtain this application
Warcrimes is probablly still working on the overlay version but in #community-resources there is the webpage version http://www.foxhole-arty.com/
A simple artillery distance and azimuth calculator
I just realized you didn't make the page version @raven igloo the actual function sounds fun, have you made that yet?
@fervent spear what is page version ?
the link I just posted
my plan is
first windows and android
then ios and web
@exotic steppe still working on it
android? ios? nobody plays foxhole on those
also how will you do directx on platforms that dont have directx?
no i mean
ive ripped the equation out of the spreadsheet version if you need that, you probably already have the equation tho
we already have web page, android app, alexa app, google now app
we were always missing an actual overlay
the closest thing was using the web page in the steam overlay, but its clunky
aye, @raven igloo good job on that overlay, it's very aesthetically pleasing. What language did you do it in?
ugh pixel perfect CSS is hell and i hate it
i used to program in c# c++ python javascript
for graphic and gui css is the best 😄
css programming language 
ridiculous lol
xaml is best for graphics
css is a disaster! god knows what support youll even find for it
and css + text = who knows whats happening internally, nobody
xaml is ded bro
you talking about wpf and uwp ?
but yeah they are good
there is no option for dpi awareness in wpf
This will make your software blury in other monitors
but yeah for example microsoft Groove microsoft store all are with uwp
and they are awesome
xaml isnt dead!
but its by far the best markup for graphic design
also i dont see why that would make anything blurry - there should be good antialiasing on the rendering engines
its not like CSS does a good job on blurriness at all
ive been working on a project lately that involves some pixel perfect alignment and its a damned nightmare in css
and im using a ton of css 3 stuff so like compatibility be damned
@raven igloo so electron is able to access directx huh?
yeah xaml > css
hows that work?
@long raft you can use c++ classes as node.js native modules
do you import the source? or are they compiled as libraries first?
we have to compile them
I do not currently use this technique(directx hooking) for the project
so youre doing like half in c++ and then the GUI in electron?
because of technical issues
@long raft yes kind
For example, to get system processes i need to use c++
what is proton
Try to tell me this isn't relevant to this channel OwO
Wind talkers not code talkers
Hi everyone, this is my first time in code talk.
I never realized we created a channel for this (its buried within the depths of the discord).
I built my first C# console application without using a tutorial.
Its a clock that uses a 12 hour format and has various messages based on the time of day.
The time displayed is based on the user's system time.
I started learning at 10:00pm last night, watched 8 hours of lectures then experimented for 2 hours via guided exercises. Eventually, I went off on my own and made a clock.
Hahahahaha, it always seems to take like forever to get something to work for the first time, but when it dooooo 😆
noice
tfw you made something and then when you add something else you break it
1 hour coding , 1000 hour debuging
never before have there been truer words said....
hi guys
anybody here has access to all dynamic map data JSON files from the last World Conquest?
and by "all" i mean continuous grabbing on a regular timebasis
Warhistory
I'm currently playing arround with some data I grabbed by myself. I wanna use the data to produce animations like this
my script is working so far, all I need is lots of data to parse it! 😉
Awesome map, I love when people do things like that 😄
unfortunately in this time period not too much was going on 😄
@versed notch you can message @pure sierra for that, i'm sure he keeps the logs
but he's muted on this server at this time
i wanted to do something similar but never got around to it
so i wish you best of luck
@barren quarry ty ill ask him!
@versed notch Cool stuff ape. What are you using to make it? We should create map recording association to gather data haha.
I hope the devs release some sort of location data through their api. Right now there is no active data for player movement ...
It would be great if they could release player location data after each war is over.
lets make a discord for community devs
isnt this the room here?
@royal glade thanks! 😃 I use python with the following packages for data input, processing, interpolation, and plotting of *.svg images:
"""
import json
import numpy as np
import matplotlib.pylab as plt
from scipy.interpolate import griddata
import os
from scipy.misc import imread
"""
after image creation I use imagemagick to create compressed *.gifs
so i was searching for a steam api request to pull the number of players in foxhole
i thought it doesnt exist because i couldnt find it
but then i did, on a totally different website
so on the official valve website this command is not listed
but somewhere else it is
what the fuck?
do you map guys already have a plan for how to display the new map?
im building the 7th layer of tiles now from baslow's map (yea it needed 7 layers)
ill go ahead and post it in case anyone wants it when im finished
if hes OK with it
i must admit the file size is ugly; i can't imagine thats inexpensive for hosting
Here's the portable leaflet map if you want to have pre-made tiles for the devbranch map Bazlow made or just want an easy to view version of the whole map; also included the source image:
https://drive.google.com/file/d/12kiMrybV2Xzw2boDKKVrmzTXc2r3Hs9S/view?usp=sharing
Deadlands
Mooring County
Hey guys,
so I was talking with @pure sierra and he kindly gave me his DB-log.
I could use the infos to create these gifs for every map.
What Iam missing atm is the Starting Information: whicht towns/forts/safehouses are under Collie/Warden control right from the beginning of every WC
Also: Discord is ruining Image quality quite a bit. *gifs look much better in reality
Does anybody of you know which Locations are controlled from the start?
Farranac Coast: Wardens - Iuxta Homestead, Colonials - Victa
Deadlands: Wardens - Callahan's Gate, Colonials - Sun's Hollow
Endless Shore: Wardens - Brackish Point, Colonials - Enduring Post
@versed notch
have given thought to this before - thought what it really needed was a kriging function - with the knowledge of the town hall ranges
because theres so much missing data in between points, all the hidden fobs
@long raft from the scipy.interpolate Docs:
"The interpolant is constructed by triangulating the input data with Qhull [1], and constructing a piecewise cubic interpolating Bezier polynomial on each triangle, using a Clough-Tocher scheme [CT]. The interpolant is guaranteed to be continuously differentiable."
@timid talon ty 😄
oh i dont know about this, will check it out
@versed notch my pleasure. 😃
have you seen voronoi polygons?
all Towns belong to the homefraction?
the other regions? Yes, the towns in the Home regions are owned. The starting point in those regions was the portbase itself.
so all towns in Mooring COunty belong to Wardens at WC Start?
yes
@long raft Yes they are Voronoi Diagramms!
I dugg a little deeper into the documentation
they use qhull library http://www.qhull.org/
Mooring, Reaching, Callahan, Weathered and Westgate, Heartlands, Great March, Umbral towns are owned by the respective faction at the beginning of the war, including the garrison houses and the safe house.
Yep
the spawn point for both sides are the portbases, except Callahan's Passage and Heartlands that have the spawn points in: CP - Solas and HL - Blemish
and forts are neutral. ALL of them.
you need to unlock tech to build them
@versed notch That looks great man
I updated the leaflet devbranch map in my post from yesterday. @vale citrus cleaned up the map further and it really looks pretty good
im a bit short on time so if someone makes one of these with an empty map (no icons or text) i will be eternally grateful
@versed notch That's good stuff man.
@barren quarry ...
@summer bobcat yeah i know but thats not the final version
they're probably going to update it
everyone is
Would it be possible with something like this in the game, the lantern?
alright so the developers updated the war api
the region extents are now same for each map
which means we can calculate the world size
1 ingame coordinate is 1 centimeter
so we have these dimensions
calculating the world length is easy in this case
just r x 2 x 5
and we get 9.45 km
the width, however, is a bit different because of how hexagon grid is aligned
the geometry tells us that a side of the hexagon is equal to R
for that we need to find which part of the hexagon the height cuts off
its a half
so we have this grid
so this is what we get
which means the width of the world is 11*1.092 = 12.012 km
surface area of one hexagon is 3.09811 km
total playable surface area is 3.09811 km *23 = 71.257 km
so results
length of a region is 1.89 km
width of a region is 2.184 km
surface area of a region is 3.09811 km
playable map length is 9.45 km
playable map width is 12.012 km
playable map surface area is 71.257 km
Devs uploaded the official maps
i downloaded them and converted to jpg (because tga is fucking huge)
cut into hexagons
considering that each region image is 1024x888, the total image size is 5632*4440
and there is no need to make it any bigger
@barren quarry Imma just mention surface is measured in km^2 (or km2 if you are one of those people)
if anyone joins that all together id like a copy
@long raft
the geometry of this is as perfect as it gets but the images themselves arent
for example the source image of great march has a black line on top
thanks thats high quality
whered they post the original tgas? im curious how big they were
@long raft https://github.com/clapfoot/warapi
oh ty didnt know their was a github
lol they committed the binary files, i do that too ^5 repackin till the end
the app is rdy guys
Looks sweet
I'm doing the final tests
After that, we can use the app
i still recommend that you add a button to make it smaller so it doesnt block the view
you can
anyone wants test the app ?
app is available in the link below:
Download App: https://irxeniac.github.io/FoxholeArtillery-Windows/
I fixed Kastow's image problem and put it up on reddit: https://www.reddit.com/r/foxholegame/comments/c0bpas/the_entire_world_map/
@raven igloo How hard would it be to add a common map feature, where someone can upload a map and draw/erase on it?
That looks really awesome.
I get the feeling that since electron has npm support, we can possibly have a common leaflet map shared through the app
@barren quarry what do you think? I've not much time to actually do it, but exciting possibilities.
Also can electron browser load webpages?
Load a common map. Then provide a layer for people to draw on top. If anyone enters the right code on the overlay, they can see the same map
People could then have live, "in game" map to draw on.
You're making an overlay too?
Oh with leaflet?
I remember your website, my question is if it can be integrated with the overlay that warcrimes uses
so people can load and use it without switching windows.
I'm thinking if electron has a browser feature or plugin, it might be sweet. Kind of like how the steam gui works on desktop
Create and control browser windows.
is tantalizing 😛
wait whats electron?
visit the front page. https://electronjs.org/. It's what warcrimes has used for the app
Build cross platform desktop apps with JavaScript, HTML, and CSS.
okay
My first impression is that it must be fairly easy to have your website load from inside the app
If we pull this off, we will have enabled true armchair generals.
Just sit at base, watch map. And provide suggestions.
😮
How I wish they would actually make it a part of operations. Geez.
wow
does anyone know how to run python files?
i do
probably missing python in that folder
which python
will tell you where its located
and you change the first line in that script to fix it
you can also just type
python gdal2tiles.py <args here>
symbolic link is another way to solve it (across all scripts)
when you find the location of where python really is, like maybe its /usr/local/bin/python you make a symbolic link
sudo ln -s /usr/local/bin/python /usr/bin/python
are you making leaflet tiles?
oh, it does not. but they have a symbolic link, i dont recommend it
and i dont want to have any business with python after that
theres this thing
and i have no idea how to use it
i just use it with ubuntu on windows, bash on windows, whatever, cygwin too would work
i couldnt get anybody else's scripts to work worth a damn
have you used ubuntu on windows, kastow? its a much better command line experience on top of windows
never used
bash on windows maybe they call it - the windows linux subsystem
its basically an ubuntu environment running on windows, its not a VM
anyway, let me see if i can modify this script and ill share it with you
ill modify it for windows maybe
or ill happily cut the map for you
please cut the map
which one?
ok
how many zoom levels? what tile size/ what background color? jpg or png? @barren quarry
here's my script for making imagemagick cut an image: https://pastebin.com/bYgADGg9
png
does there have to be a background color?
its transparent
lets say 5 zoom levels for a start
@long raft
oh ok let me try transparent lol
never done that before
so ill assume png
heres another assumption i make - the map is scaled and centered (add background to the top and bottom to make it square)
hope thats ok, shouldnt notice it with transparent background
cool it works
i can do 6 layers easily, 7 layers takes a little while, so ill run 6 layers
jeez if i just put this through xargs i could multithread that script
yep 6 layers was overkill, actually said i was scaling it up, not down.
delete all the 6_ files if you dont want that layer, @barren quarry
thanks
theres some weird looking tiles in there, i should probably make sure this works lol
no hang on its cropping the last column, i think
really have no idea why either, it didnt do that to mine
sorry, @barren quarry I think it's mangled, let me have some dinner and I'll work on it and have it to you in a couple hours
@barren quarry here's 5 layers, 0-4. I've got some trouble when the layers scale larger than the original image I have to fix, I'll send those when I have them working
@royal glade everything is possible
@royal glade also you can load webpage in electron
window.LoadURL("web adress");
@barren quarry if you need a UI design for your project i can help you with that , code , UI/UX
im having trouble adapting leaflet to my map
why you dont using a single svg for map instead of 20-30 png ?
@barren quarry ok here's the full 6 layer dip https://drive.google.com/file/d/132MeTgzXKWzN4PpVaz60uYl2Da6me0t5/view?usp=sharing
that last layer threw me, had to just write a c# program to do it, way faster, will use this from now on
yea its sizeable, its like half that size if you pick a background color and go jpg
the original one i did was 7 layers and more zoomed in. it took a while and is overall antiquated now
these files are taking ages to upload lmao
i have to divide the layer 5 into 13 batches because github only accepts 100 files at a time
if maps change after this im gonna be really pissed off
in the future we probably wont use layer 5 when the new patches come
cause uploading 1024 files every time is not a fun experience
its done
ok so what now
now i need to link this somehow to leaflet
the format is https://raw.githubusercontent.com/Kastow/Foxhole-Map-Tiles/master/Tiles/{z}/{z}_{x}_{y}.png if anyone wants to try
yeet
the bounds are really weird
ok im more or less figuring this out
hehe
IN COORDINATES Y GOES FIRST CAUSE ITS LEAFLET
k= deadlands height in pixels,
w= region width = k/1.89*2.184=k*1.156
O= center of deadlands
boundary formula, c - center
[[c-k/2,c-w/2],[c+k/2,c+w/2]]
Umbral Wildwood=[O-k,O]
Great March=[O-2k,O]
Callahan's Passage=[O+k,O]
Reaching Trail=[O+2k,O]
Loch Mor=[O-0.5k,O-0.75w]
The Heartlands=[O-1.5k,O-0.75w]
The Linn of Mercy=[O+0.5k,O-0.75w]
The Moors=[O+1.5k,O-0.75w]
The Drowned Vale=[O-0.5k,O+0.75w]
Shackled Chasm=[O-1.5k,O+0.75w]
Marban Hollow=[O+0.5k,O+0.75w]
Viper Pit=[O+1.5k,O+0.75w]
Farranac Coast=[O,O-1.5w]
Westgate=[O-k,O-1.5w]
Stonecradle=[O+k,O-1.5w]
Endless Shore=[O,O+1.5w]
Allod's Bight=[O-k,O+1.5w]
Weathered Expanse=[O+k,1.5w]
The Oarbreaker Isles=[O+0.5k,O-2.25w]
Fisherman's Row=[O-0.5k,O-2.25w]
Godcrofts=[O+0.5k,O+2.25w]
Tempest Island=[O-0.5k,O+2.25w]```
i wrote this text and then just put in the variables
im gonna make it a single message
Repository for map tiles:
https://github.com/Kastow/Foxhole-Map-Tiles/
Demo:
https://foxhole-tilemap-prototype.glitch.me/
Demo source:
https://glitch.com/edit/#!/foxhole-tilemap-prototype
Hey guys, we've just updated the docs with the URL for the devbranch API https://github.com/clapfoot/warapi
1 "TempestIslandHex"
2 "MarbanHollow"
3 "ViperPitHex"
4 "HomeRegionC"
5 "DeadLandsHex"
6 "HeartlandsHex"
7 "EndlessShoreHex"
8 "WestgateHex"
9 "OarbreakerHex"
10 "MooringCountyHex"
11 "WeatheredExpanseHex"
12 "LochMorHex"
13 "StonecradleHex"
14 "AllodsBightHex"
15 "ShackledChasmHex"
16 "LinnMercyHex"
17 "GodcroftsHex"
18 "FishermansRowHex"
19 "UmbralWildwoodHex"
20 "ReachingTrailHex"
21 "CallahansPassageHex"
22 "DrownedValeHex"
23 "FarranacCoastHex"
24 "HomeRegionW"```
Thanks, will take a look
link it to leaflet? i already made a leaflet like 5 days ago
oooh excited for new war api!
@barren quarry the bounds are like -128,-128 to 128,128, it seems to pick up the first image as the size
and if you dont properly set the bounds itll scream about 404 missing tiles
the bounds are -256,0|0,256
oh i was using CRS.Simple
im excited to grab the town coords with code rather than by hand, though ...
i have wasted a tremendous amount of time on maps in the last week. first doing the tiling - i wrote a script that took me 6-8 hours to run; yesterday I rewrote the tiler in c# and now it can process all tiles for 7 layers in about 15 seconds
and then picking out each individual town hall in QGIS, then the api gets released 2 days later
in png or jpeg?
erm ... lol how
i didnt do any work to improve the saving, i just used the default system.drawing.bitmap.save method
but i didnt really think png offered compression levels, maybe so
the real savings is jpeg tho at 95% quality
youd have to choose a background color, but thats going to be the smallest size
are those text labels SVG or html?
i do this with my svg labels:
stroke: black;
paint-order: stroke;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-width: 1px;
fill: white;
nevermind
its white text with a black border, its very legible, reversing the colors works too, but particularly contrasting stroke and fill colors, with the stroke drawn under the fill
@young pilot there are no forts on the bottom of great march
oh lmao
your latitude is reverse
reverse latitudes for regions
my algorithm should not be an issue, it cannot move the map more than 1 space
var xcoord = mapArray[regionId].center[1] - (w * 0.5) + (w * x);
var ycoord = mapArray[regionId].center[0] - (k * 0.5) + (k * y);
the way leaflet counts coordinates and the way war api counts coordinates DONT MATCH
^^
leaflet is default wgs84 nonsense
kastow, did you change the region params or anything
i dont know why its reversed
or whatever
no i didnt
this is what i have in the setup
i bet if you check the war api its wrong
the towns look right, its just the forts, right?
IDK
var ycoord = mapArray[regionId].center[0] - (k * 0.5) + (k * y)
here you need to write var ycoord = mapArray[regionId].center[0] + (k * 0.5) - (k * y)
if you do this you will fix everything
war api was perfect huh? hm
i just realize what is going on
and kastow was right
actually war api is not perfect because im missing a region for some reason
might be because of me though
hmm
i think i know why
anyway, yah, label border, stroke first, fill second
my dynamic counter is 1 short
errr
give me a second, it was correct, 22 is the number of regions
unless
i forgot to put a region
fuck
const regionNames = [
"GreatMarchHex",
"TempestIslandHex",
"MarbanHollow",
"ViperPitHex",
//"HomeRegionC",
"DeadLandsHex",
"HeartlandsHex",
"EndlessShoreHex",
"WestgateHex",
"MooringCountyHex",
"WeatheredExpanseHex",
"LochMorHex",
"StonecradleHex",
"AllodsBightHex",
"ShackledChasmHex",
"LinnMercyHex",
"GodcroftsHex",
"FishermansRowHex",
"UmbralWildwoodHex",
"ReachingTrailHex",
"CallahansPassageHex",
"DrownedValeHex",
"FarranacCoastHex",
//"HomeRegionW"
]
mustve forgotten one
lend me your list
"CallahansPassageHex",//4
"MarbanHollow",//5
"UmbralWildwoodHex",//6
"MooringCountyHex",//7
"HeartlandsHex", //8
"LochMorHex",//9
"LinnMercyHex",//10
"ReachingTrailHex",//11
"StonecradleHex",//12
"FarranacCoastHex",//13
"WestgateHex",//14
"FishermansRowHex",//15
"OarbreakerHex",//16
"GreatMarchHex", //17
"TempestIslandHex", //18
"GodcroftsHex",//19
"EndlessShoreHex",//20
"AllodsBightHex",//21
"WeatheredExpanseHex",//22
"DrownedValeHex",//23
"ShackledChasmHex",//24
"ViperPitHex"] //25```
its oarbreaker, right?
Layers
so @young pilot howd you compress the pngs?
really?
ok so here's a million dollar question
there's a 0.65-0.7 difference between hex coordinates and the actual map borders
Oh i know why
wait no
i dont
fuck
ok yes i know
yes
the way i calculated height was wrong
now its fixed
Am still curious about the png compression
@young pilot 8 bits? 16 bit png?
that must be what it is, im not gonna add that to my program because it assumes low color depth to the source image
I published my tile slicer, works in Windows, Linux, theoretically OS X:
https://github.com/NoUDerp/Tiler
aaaah git force rebase + git force push; making it look like you did everything right the second time
rip when your graphics driver updates in the middle of FoxholeLowLevelFatalError [File:Unknown] [Line: 200] Unreal Engine is exiting due to D3D device being lost. (Error: 0x887A0005 - 'REMOVED')
wow thats some kind of bullshit i wouldnt see even in rimworld
matched the background to the map
more or less
[[-349.538,-265.846],[93.538,521.846]]
these are bounds to make the background match the map
@barren quarry What is that green flag icon that is a victory point. (In the south west hex)
Imagine that world map but with twice the number of hexes
@royal glade It's the Civic Center icon. VPs must have this facility upgraded in order for it to count towards to win condition.
@summer bobcat thanks.
has anyone got the icons for Construction Yard and Oil Well? and could you send them to hayen. thanks
hayden Today
so, update 0.26 rolls tonight for me at 3am so ill be a sleep and ive been busy getting ready the best i can, focussing mainly and making my data collection and stats work and not get corrupted by changes while collecting all the new data as it happens,
thus i ran out of time to do much on teh map overlay segment but the basics, hopefully when the update rolls you will see this screen instead of the current one and ill continue improve things over the days to come
and hopefully it will show the new maps not this dummy data
dont get muted guys every post through drunkle mute avoidance is 1 commend 
ineteresting, i was wondering how he would keep the design with the new map...
it actually looks alright
This works
@long raft
the galaxy requires your assistance once again
On what
cutting the tiles
oh ok, on which image
i published that tile program, can literally just drop image on .exe file and poof its done
i will contact you soon when i have the image
@barren quarry
thanks
@barren quarry
i have a tile cutter but it only works with squares anyway
i think they all do that
i just scale it up to square and center it
@barren quarry i used https://github.com/NoUDerp/Tiler, not that gdal2tiles
alright
im fairly certain this is the easiest tiling program that exists
hi mates, as far as i can see in the war api description data about resource fields and mines should be available, since they are now more important and their distribution changes every war it would be nice to have them also visualized on your map tools, moreover factories, refineries and depots are now faction bound which could be also shown, TIA
@barren quarry ^
as far as i know all available data im showing in my website ? @final palm
good god
bad idea trying to use define as a variable name....
a new record for kills for hour , im going to have to adjust the coloring scale
on another notei get 29 victory towns in the api but in game reports 25, i have mentioned this to phil
So Phil has phill'd me in 😂 there are 29 available victory towns of which only 25 are needed to win
alright, going for a second round with that Rapsberry I bought quite a while ago
What I managed to do this time: make it work with Python 3, have it handle my keyboard propperly, make it run from a cmd window at all times very smoothly (so only keyboard needed), have a longer charging cable so I dont have that fucker stretch across my lap at all times
I am working on: getting github linked so I can run my damned script
what I am currently gonna do: go to bed, first work day tomorrow at 10 o'clock
i just set mine up too, turtle! this week lol
figured out how to connect it to wifi and run SSH on boot, so i dont need a keyboard or video
you can also use real vnc on it
yea i like to use xrdp, because then i can just remote desktop client, and can even weave sound into it
in this case i was going to run it headless tho, i just needed a console. was excited to see i can run docker on it
so ive set up a striped back event log for twitch streamers
you add the url as a browser source
you can set the fadeout time with fade parameter
https://foxholestats.com/?stream&fade=240
also if you set the fade=0 it wont fade them out
rewrote my logi website almost from scratch with my buddy @chilly burrow doing the design
amazing
@long raft I am using Raspbian Stretch Lite, that downloads only a cmd window and some basic drivers; lacks even stuff like libraries, so it keeps shit clean
I'm still crippled on this pi zero, because it's arm v61 architecture 🤔
I need version 7 to run any of my code
hahahahahaha, I am not going that hardcore lol
It's less hardcore than you'd think...
just need me a Python 3 and establish a conection with github, and I will be fine I think
I think
Yeah I guess that'll work
and I fixed the python 3! I have an internet connection! Halfway done!
@barren quarry the site is impressive. Great work!
thanks
@royal glade
For others, ^ note how vision circle dips near the shallow transition
@ drowned vale
explain me this
it keeps telling me that 33 is bigger than 203
fucking javascript
it fucking compares text
and 3 is bigger than 2
yep, that's a classic javascript thing
things like these, you just need to keep on stepping on the rake
until you stop stepping on the rake
there is no explanation that is adequate
all things are at the mercy of the JS engine
slightly less annoying than languages that interpret = as assign and not compare
oh javascript one of those too, right
u wot?
== being a comparison and = being an assignment is standard in all C likes
its literally the least annoying part of JS
well, not taking into account that [] == "0"
i grew up in BASIC, where stuff works like you expect it to.
assign is := or <-
ya know, pascal or mathematical notation. dont pretend like youve never been thrown by a mistaken = instead of == (or even worse with some languages ===)
my first programming language in school was delphi lmao
i love php, no type or variable declaration / consideration necessary, python is even simpler, but not used that as much
I've made the occasional == vs = mistake
but then again, ;
or even, heaven forbid, mixed spaceing
oooh boy, spaceing just gets on my nerves
one of my friends who I occasionally collaberate with uses spaces and I use tabs and we just hate whenever the other one commits
we both agree on \n line endings
like that's an issue anymore
cant even imagine where people learn spaces
some popular IDE or language that insists on spaces?
it is a bit silly forcing structure through spacing like that, but i guess its to do with the logic, php just lets you create brids nests to your hearts content,
yeah when you do if(variable = true)do this; and cant for ages work out what the heck is going on...
@languid harness = as compare is in XSLT and a few other functional languages
considering you assign things inside an xml tag, better than expected. I chuckled
and BASIC ... and pascal, some of the most important HLLs
When this said code talk I thought it meant like cryptography
I immediatly thought navajo, then I actually looked at the channel
this isnt morse code?
this is binary
this is ASM
real men write their code by manually flipping bits on a hard drive with a magnetized needle
manually
hey @barren quarry I saw when you posted the bounds of the map to fit the points - i dont quite get how the normalized coords are turned into absolute coords, any guidance on this?
assuming the normalized values are multiplied by the extent, but how do you know where the region lies?
also curious to know units <-> meters conversion, this sure seems like a lot of manual work
@long raft what do you mean by normalized coords and absolute coords
the x/y coordinates are between 0-1, right?
i can tell you about the units to meters conversion but i have no idea what you mean by normalized and absolute coords
they are 0 to 1 in the api requests for regions yes
doesnt it need to be offset so that it fits on the full map correctly?
im just going to tell you how i do everything
so here is a map image
what is the only thing we are absolutely sure about in this image?
that the image width is equal exactly to 5.5 region widths
because of how the regions interlace each other
and from that go the rest of the calculations
should i continue?
that might be enough
i dont have to define a custom offset for each region, but ... kind of
yea i guess theres no way around that then, just have to look at the map and define the tile order
ok thanks, it helps to know the width
i described it here about 2 weeks ago
oh i saw you shared the bounds, ill take a look back through then and re-read it
so i have a bit of an issue
glitch is a good website but it has an hourly request limit
if the limit is broken the website goes down for some time
and this limit was broken during devstream
so does anyone know where i can host my website, preferably for free?
what does it need?
the requirements are not that big, i just dont want to have request limit
well theres the cloud providers, google, amazon, microsoft, they offer like a free tier for a year

