#code-talk
2 messages Β· Page 6 of 1
it was a high detail image - hard to work with so I had to set up a tile server, but which map you pick is important for the alignment and centering
and another big thing - this might come into play for you:
the default projection is wgs..blahblah84, the standard everyone uses for spherical earth
its fine when you place points, the projection doesnt matter much, but when you draw polygons and shapes (like a circle) they come out projected (they look elliptical)
you can turn projection off in the project properties
i did
ok
and running leaflet in pixel based simple crs
ok right
i find qgis not to be a good point editor, like i imagined i could transform the points globally, but i couldnt, i just had to move each one individually
i guess it doesnt matter what you make it in
qgis is really the only free game in town - i just worry it may be difficult to merge them together, i dunno
nah just add them as seperate layers
yea i guess all the images are the same size
ill try a map tomorrow, see how fast it really is
we will be missing the roads between maps...
make sure to turn on snapping
theres a few things i had to do to get it outputting correct format
snapping?
in qgis
ill look for it
ill look at pushing my demo to github
the json file is pretty helpful
i think i know how to achieve that
i can see how snap is important, yea...
i mean th elibrary does group vertex of closeness
mapping is not the hard thing though, its expanding on my current demo, currently i dont use the leaflet router plugin. so that could be looked into if its worth it, alse i dont have more than 2 waypoints, also it would be good to have snapping when dragging icons around like the demo, also search may want to be a thing ?
also there is a problem with the distance it calcs and returns, i have created an issue at the router git, as i think its hard coded for world lat lng, space, but im using pixel coords
https://foxholestats.com/router/
you really need to put the marker directly onto the road
small beans compared to literally all the features that are yet to be implimented, but it woule be nice to have a little leeway
also, maybe fix/round the displayed distance to a hole number or to a few places
though, that might be related to the coord system...
@pure sierra that field you have in yours, the default id which is unused, maybe it would make sense to make a new field to replace it called name, string type, that has the name of the road
doh, there is no labels on the maps to even know which road they are haha
yeah, i had no need to add any fields so far, something that can be done though , is a modifier could be specified to specify if its offroad slow @long raft
@silk verge the distance is not calcing correctly afaik, im looking into it, then i will make it pretty, its dijkstra
@barren quarry yes, proof of concept
@silk verge that is i think where the routing plugin for loaflet would come in, but if not some kind of snapping feature
the routing plugin looks up the names and resolves them to waypoints, and its got graphics and control mechanism
not me
i got the distance calculating correctly into km
node as in node js?
yes
so the library uses all these 'requires' somithing only noed supported, so you cant just use the lib like 'normal' and just include sthe <script> you afaik and could work out have to 'compile' it with like browserify, which i have to do for the base level of code to get it into the dom, so i can use it 'normally' , but it has to be recompiled if any 'base' settings are changed or the map json
so you're talking about doing stuff with libraries on front end
well it does it
so for starters on the guide to use it in the readme it says:
var PathFinder = require('geojson-path-finder'),
geojson = require('./network.json');
var pathFinder = new PathFinder(geojson);```
now this wont run in a browser
right
i use webpack to do this
im gonna be honest... it took me a lot of time to figure this out and i dont even think i remember how to do it
that seems to be the same as i did via browserify
well it does that what im using now
i think i tried it but didnt have any luck with it
on another note, is your previous comments about the map height being 1.89km still correct ?
ok
i had this somewhere long above
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```
also , do you have a big image with all the maps joined together ?
if youre going to work with the big map its unwieldy in qgis, youll need tiles
or just use a blurry 256x256 version i guess
mm look at that blue ocean
@pure sierra simple
map bounds
maxBounds: [[-248,-20],[-8,276]],
wait no
ah nevermind
so as derp said you actually want to use tiles
no one's gonna load the full 13 mb background every time they load the website
i have a github repo pinned in this channel
qgis will not use local files for a tile server tho - so you can upload them to a server or you can use an existing server, or you can run php -S ./tiledirectory
it should have enough instructions
alternatively, we can map each map individually, and then using the offsets kastow made just shift them (I could write a program to modify the json contents) and join them together - but then the connecting roads need to be finished
the full map does load in qgis for me
i started working on weathered expanse, ive gotten like 25% done while i wait for linux servers to setup heh
it just flashes when zoom in and pan, but can live with that
yes, the full map will load, its just really slow
well like you said, we can setup a tile server
kastow already has one lol
use his
it might use a lot of his requests up, i dunno
its good if we all work on one set
its just static files, so it would be easy to set up anywhere, but like i said I just used php -S to make a local web server
i have webserver
kastow's tiles are the png quantized one for reduced size
it might use a lot of his requests up, i dunno the tiles are hosted on github
you can request them as many times as you want
your site hotlinks the tiles from github??
well thats the answer then, damn
ive never thought to use github for hosting like that, lol
so I guess set the QGIS XYZ layer's server to https://github.com/Kastow/Foxhole-Map-Tiles/raw/master/Tiles/{z}/{z}_{x}_{y}.png
how many zoom levels kastow ?
0-5
yeet
now we just need a online vector database !
as far as i know, shape files are binary and git wont merge them. would have to export to geojson to do push/pull requests
are you starting over on a global map, hayden?
not right away, i will still maintain the current test bed for feature development, but im looking into vector online database for collaboration on the global map
any suggestions ?
geojson file
but can that be saved to onilne fromqgis ?
im trying to make a json file on github but its not working for some reason
whats the problem?
when i press "raw" it just opens a blank page
am i retarded?
works for me
oh nvm now it opens fine
now im gonna test if i can pull this data via an xmlhttp request
aaaand yes
this works
here's the plan
we finish this thing
i upload it to github, or someone else can upload it if they want
as json
and then people can just pull the data from the link
im looking to make a colab workspace
basically what derp said is correct
browsers dont allow CORS by default
but lets be honest the war api data is also third party
we just request it on server side and serve it as our data
same applies to the geojson data
the server can pull it from github on launch and then just serve it as its own
ya i think youre better off making a readme that shows how to set up qgis with the tiles, and import the geojson file, and then how to export it when finished
so i have a cloud db accounh working in qgis
but just looking for something a bit bitter
@barren quarry
in your maps is 00 in the center ? or a corner ?
as in the tileserver map we just got into qgis 0 0 is in the center
the leaflet coordinates?
i guess
in leaflet 0,0 is not even part of the map lmao
tiles in leaflet work in a very specific and retarded way
so X goes 0 to 256
and Y goes -256 to 0
but i thought you where running pixel cords ?
Yea
but when you load a tile map for some reason it always loads it in boundaries of [-256,0],[0,256]
ah ok
the center is then of course -128,128
u there @long raft
yea, just actually working hard today 
np
tiles are 256x256, so the top tile layer 0 is 256x256 and thats what leaflet uses as the size...
sure
just trying to work out the coords in qgis
when i was just using the single image it was essentially pixel coords
but with the tiles its some massive amount extents that im not sure where comes from or how to set
is it just a factor of 256?
-20037508.3427892439067364,-20037508.3427892550826073 : 20037508.3427892439067364,20037508.3427892439067364
yah I had the same thing when i did my devbranch map ... it did line up tho...
oh I guess i modified each point using the extents:
var modifiedPoint = [-128 + 128 * (coordinates[1]) / 20037508.3427892439067364, 128 + 128 * (coordinates[0]) / 20037508.3427892439067364];
i dont even remember doing it 
oh
@barren quarry
is that big extents that i got there , seems to be same as if you added up all the extents for each map
how the heck is that lining up ?
os you dont have the extents set in your tile server that is loading in qgis ?
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```
these?
from the api
yeah its based on the api
i made a hex grid to help work on one map at a time
im thikning your idea @barren quarry of using github for jsons migh be best as you have commit history. i did even get a postgresql/postgis server running and connecting with qgis, and i could store and save vector layers there, and i could assign permissions per user to different tables for each map , but things could still get wrocked with no revert feature ,(apart from backups, which i do have) but i think just simplify it
so afaik it looks like you cant idet a geojson in qgis, you have to import it convert it to shape edit and then re-export
it can import and export geojson, but yea the vector layer is usually esri shapefile, natively
i imagine you will have to download it first
but it offers http option
itsa https problem
ok i made a quick guide: https://github.com/hayden-t/foxhole-router
hayden i thought you said you turned projection off in the project settings?
i did, but then the xyz tile layer forces to come through as google crs,
it doesnt really matter though
you can likely have it off
so thats where the big coords systme comes from
its the number of meters around the world !
40,075,016
so i will have to change code to translate qgis coords to leaflet coords, as no longer using pixel cords in qgis (unless i can find some way too) plus leaflet will be in 0-256 now too if it tile mode, ideally it would be great if me could get qgis in 0-256 coord system !
yea the xyz layer is the wrong crs but its not used for anything otherwise
unfortunately it sets the range of cords the come out in the geojson we make
can just adjust it all after it's done, or post process the points
its much easier to deal with uniform scaling than projection
yea, coz also to save on json space as well as dropping all the decimal precision we can divide the main number down alot, to make coords not take up so much space as there like ~ 5 digits of significants we dont need
can i put your name down for a map @long raft
@barren quarry ?
yep
lol
just easier to start over i think
happy to stay with that map ?
yea
i may have to go see it in person tho, some things i cant tell if theyre roads or building locations
i like it quite a bit but ... i dunno when i saw that one satellite view map π π¦
im going to start on marban some time, as its next to yours so we can get cross map demo first
where did @barren quarry move his server to ?
np
tldr: will you try doing a map one day ?which one do you want ?
there, that didnt take too long:
looks good
much nicer & easir when you apply a thicker line style
i added that tip to readme
ive also added the json and a preview
ive changed instructions to end road at border, not over it
so better chance of noxt map ending at same place
@pure sierra What plugin do you use for routing?
@pure sierra is that for a Foxhole GPS?
@fallen dirge yeah he's trying to make it like Google Maps so it can give you the fastest route to a destination
thats fucking cool
Very cool. Where will this be when complete and ready?
how longs a piece of string ?@hardy marten you can see a simple demo only on one map here: https://foxholestats.com/router/
@barren quarry so far just this plugin for route https://github.com/perliedman/geojson-path-finder
he also make the leaflet routing plugin
@chilly burrow may want to help
if you don't mind, a system like this would be very useful in our website
Very cool guys. Keep up the great work, the community appreciates it.
its probably safe to say that this channel is more supportive and friendly than most of the clans in this game lmao
question, is anyone working on / know of / is interested in, a tool to assist logistic requests and such
question, is anyone working on / know of / is interested in, a tool to assist logistic requests and such
@barren quarry has a website that may do what you want
is there a link for
is there a link for
is there a link for it?
is there a link for it?
is there a link for it?
that said, you need a group of people to work with if you want this tool to be useful
ah nice
that said, you need a group of people to work with if you want this tool to be useful
there is no functionality for cooperating with randoms, yet
yea, I was thinking of making a sort of request board
those in the war can kinda just help call out what resources are needed where
those in the war can kinda just help call out what resources are needed where
is there plans for?
??
just repeating the same thing
my discord is lagging
oh yea, I think thats happening a bit all around
mine too
i think the devs will be adding this sort of thing in the next update
coming along
thanks @barren quarry , there will be a bunch of these corrections that will need doing over time, i will pass this on to @LazP
theres another spot like that near Solas Gorge
@barren quarry so where did you move your website ?
@pure sierra im still in the process of migrating
does anyone know the unix command for uploading directory with replacing files?
ah nevermind
i just had to stop the server first
@pure sierra how can I help plot the roads? (If you still need it)
I can do a hex or two later tonight
hayden made instructions at https://github.com/hayden-t/foxhole-router
Looks like heβs all done all the maps
Except for the issue with farranc at the the older terra and lux shallows
Welp. :\
i dont think hes finished them all tau, i think theres a lot left
i dont think it's even half done yet
im supposed to do one, probably gonna do that tomorrow
lazp has been doing them all (i did one) teh guy went crazy and has just about done them all himself
oh i see like half in there
daaaamn
so i told lazp to stop
lol why?
so some other people can do some
there's other parts to do right? the geocoding regions?
theres no rush
yea ok totally fair
mainly coding
which ill also take any help i can get with
so far
so there are 5 more sectors to be done
@royal glade so pick one if you want
wow thats great
@long raft did you still want to do a map ? i think you might have to switch
to one not done
np
so its kind of a relief
save you for coding
javascript not totally my strength either
what is?
π
i think the geocoding part gets tricky because per liedman doesnt have a library for the geocoding, it's going to just be indexing POLYGON shapes into a database and querying on that for reverse geocode. geojson is a fine raw format but it's got to be indexed to be queryable
postgres, mysql, or spatialite? at least spatialite would keep it in a portable format
can even populate it on the client side for maximum speed that way
yea, it would be nice to have at least the forward lookup, to type in "salt flats" because you dont know where that is
but generally you will know where you need to go
unless maybe its an order from someone
i dont know half the map anymore
sure
i find node confusing
there are still missing maps on the github
there were 5 missing when h e posted the last image
any of you nodejs guys know how to import one of these javascript libraries all full of requirejs dependencies into a regular html page?
you need to use webpack
ΠΆΠΈΠ·Π°
@long raft browserify
or browserify, yes
that is also cool
done
how come we didnt use linestring instead of multilinestring?
qgis defaults to multi
couldnt change this
there is option to convert though
which must be done
you asked what my strength was - this is my thing hehe
cd Mapped; for f in `ls *.geojson`; do ogr2ogr -f "GeoJSON" -nlt LINESTRING "c-$f" "$f"; mv "c-$f" "$f"; done
@pure sierra I made a pull request after converting them to LINESTRING
Madman
I'm going to merge them all together also, I'll make a different pull request with that also
ok there, new pull request with all LINESTRING but also a Unified.geojson file with them all merged
@pure sierra That's the craziest game of ticket to ride I've ever seen
@sharp breach ?
@long raft not enough to just change word , structure is different

OK
What does that do
converts formats usually, but in this case LINESTRING
This is a better installed for GIS programs (including QGIS, Grass, gdal, etc...): http://trac.osgeo.org/osgeo4w/
You can also install the gdal packages available on Linux, etc, which includes ogr2ogr which is a conversion utility
it looks like the cygwin installer, i'm not sure exactly which installer that is, but it works the same
i also used ogrmerge.py from that package. Imagine having to manually do it 23 times 
Not a big deal
How about scaling down the chords to 0-256 for leaflet
With only keeping about as much precision for half the width of a road
Please push any scripts you use too
i put the commands I used in the commit message, they were not entire scripts, just 1-liners
I'll see about scaling, I don't know that off the top of my head but it seems possible
yea I can do it
I was reluctant to put the scripts I used because people may not have the packages installed, and the scripts would just error
I can modify the readme file though
See of you can so densify every x length too
densify?
Vertex
eek nvm wrong one
Even of you don't scale, it would be enough to truncate the decimals and likely about 4 or 5 integers off the end
hmm might take a custom program
i dont see any programs in the gdal package that transforms coordinates, yea I think it would need to be something custom, I could write that in c# pretty easy
lol
it's a task for someone else then
here's the results, though. Looks perfect to me in qgis
it's about 1/3 the file size of the original
oh doh! That's scaled to -1, 1. I did not scale it by 256
Ok this one I scaled for -128,128 range
Will check it out when home again
I posted the c# project on my fork under a separate branch. https://github.com/NoUDerp/foxhole-router/blob/fitted-for-leaflet/ShrinkUnifiedGeoJSON/Program.cs it was only like 10 lines of code but I'm just not a node/python programmer, would have taken me a while. Maybe somebody would find the code useful tho
There's an error with an empty geometry in the previous unified set, it wasn't a problem until it's used by the path finder
god I really hate javascript. Hayden do you know how to implement this IRouter interface in the leaflet-router-plugin? I can't find his source code, I just get an empty this keyword killing everything. No idea htf people work in these untyped languages with no documentation
look at my demo ?
nah, I haven't seen it, but I didn't really run into any difficulty with the geojson-path-finder. Did you integrate it with the routing plugin? That's where I'm hung up
do you have it posted?
there's just not enough documentation to use this plugin, I'm afraid. or I just can't find it..
binding the callback seems to work. what a tricky language if you dont know all the caveats of stuff
sorry yeah i did use it in the demo
but there is demo on creators site
check the git pages branch
well Hayden if you know where there's an example where he implements IRouter and doesn't just use the OSM ones, I would love to see it - I can't find it and I can't get any further
got it working, but it just wont draw the lines, and then I was going to move on to the geocoding. I think the first thing is a JSON dictionary of town names, forts, maybe the resource nodes...
where is your demo ?
I made a demo branch on my fork: https://github.com/NoUDerp/foxhole-router/tree/demo/Demo
if I debug the javascript, it's definitely calculating all the coordinates right, I just don't know the last piece to actually draw them
so your using the router plugin, (as well as the path finder) what does it actually do for us ? @long raft
me learning java: this ain't so bad
realizing that it was just the tip of the iceberg: 
ill take java over javascript any damned day
@pure sierra it was mostly about the unknown unknowns. im not sure how much work has gone into the routing plugin, but it integrates both the router and the geocoder. kind of didn't want to re-invent the wheel
but I have the router plugin and path finder mostly integrated, it just wont draw, I think it might have somethign to do with the Itinerary class, but I just don't know
maybe I need to manually draw the lines in my IRouter implementation, I just don't know because I can't find example code - and his documentation is terse
also, that repository/branch has the most correct unified geojson file, I had to translate all the coordinates to work with leaflet, because leaflet has no way to offset the tile layer
look at the source for his demo
you the the js other than bundle.js generally are the ones that get bundled into the bundle.js
im pretty sure this is where i found him drawing his lines : https://github.com/perliedman/geojson-path-finder/blob/e576a2739f897e714f93084d52ac9301a8e0ecca/index.js#L102
i created an organization for us
and invited you
message me if you want in
@long raft @pure sierra and @young pilot have been invited
the invitations are sent via email so check those
your from australia too @young pilot had no idea ! im in NSW
@barren quarry i joined
lol
Oh snap
the maps dont give out enlistments and day of war anymore
they dont give out casualties either
wait what
π¦
thanks hayden will take a look
@long raft it appears the war report data has been moved to another link
i informed hayden
i wrote a big post here but dyno removed it for "spam"
Eh spam?
@pure sierra i think some url was changed. the docs should be updated now i'll check. not sure why we forgot to give you guys notice. we'll make sure we don't do that. sorry.
particularly seems im never up for wc start/changeover due to timezone
yeah... sorry that's our bad we should have given you guys notice on that.
docs should be udpated now let me know if you need any clarification etc
ok, i think i got it to point of working like it was before, but im in a rush and have to go to offsite work, so who knows, fingers crossed, home agaain in about 10 hours
OK , manualy rollover of WC data done, hopefully that will be the last time i have to do that and it can be automated with the latest additions in the api to differentiate between wars, conquest and resistance modes π
@pure sierra I dont know if I'm the only one seeing this issue. I noticed that foxholestats still showing 25 civic centers needed for victory, while the actual number needed in game is shown as 20.
There are only 23 civic centers available, as far as I can tell
come on hayden wake up
im up
6:44am here
o oh
@barren quarry
@keen dome clarification plz: in the api new endpoint /war does the requiredVictoryTowns value change if a town gets nuked ? or do you take away from it value of scorched towns ? or ...
@pure sierra hey, requiredVictoryTowns shouldn't change in the WarAPI due to rocket blasts, but I'll double check the implementation and update the documentation accordingly
ok, also likely related i noticed, there is no etag support in this endpoint from what i can see, not that i care
talking about docs, @zealous sonnet did you see this too:; https://github.com/clapfoot/warapi/issues/64
yeah check the issue π
@swift ingot thanks, i had not had time to lok at now /war endpoint to get this new data, but doing it now
@zealous sonnet also there is war number reported by endpoint, but not in docs
you're right, ill add that as well
@pure sierra I'm going to update a few other things also. btw, the new endpoint (/war) will only ever update at most once per minute, in case you're wondering
np, i only update once per minute
@zealous sonnet you didnt add warNumber to the example return json in the readme
also no mention of it ruqired towns reduces with scorched or not,
assuming scorched reduces required total
@zealous sonnet there is something
I was thinking about scorched and required.
And that scorched won't necessarily reduce required unless total available is reduced to required
As currently there are more available than required
So one getting scorched means there are still in this case 20 available to be required
So required does not need to be changed.
But it would be good to know if it had been coded for required to change if needed, eg if scorched is greater than surplus victory towns
a victory town becoming scorched reduces the required victory towns regardless of whether or not you could possibly win the war without that victory town
so if you need 10 towns, and there are 25, but one gets scorched, the requirement is dynamically lowered to 9
it doesn't currently. if it does in the future, we'd probably just add another field for it
right now you can infer all of the necessary info from that field + the map data
Yeah is fine like that
i need an advice
i have a function
the function sends an xmlhttprequest
i want it to return the response
but here's the problem
the "return" only returns the result from this function
but i need to return from the container function
oh kastow why dont you just put the return on the bottom of the outside function
well the xmlhttp requests are asynchronous
so the return in the outside function would be cast before we receive the response
in short, we have onload function nested inside sendRequest function, and i want to somehow cast the return in sendRequest when we have the data from onload
because casting return inside onload doesnt do anything for sendRequest
thanks stackoverflow you piece of shit
you can set a global variable
since everything in javascript is threadsafe
and you can just check to see if its null/undefined
the ugly ass singleton model >_<
or maybe do something fancy with async/await
yeah i just made a global variable
why you dont just use jquery ?
There appears to be some snapping/precision issues as some paths which are clearly shorter are avoided, also no path to tempest works for me
hey
i figuced there would be issues that we will hae to investigate and correct in the maps
cool you got it working
@long raft
yea when i zoom in i can see the breaks
cheap out sourcing ?
im not certain if it was no snapping enabled or if it was the post-processing that broke some of them, some work great
connectorrs ?
the ends of the line strings
you think just at border edges or everywhere ? di you try adjusting the grouping distance paramater ?
yea i think its the border edges
yea ive played with the precision, it might be able to be dialed in... but some of them are pretty far off
if the precision is too sloppy the router will cut corners across fields
well we just have to go and snap each border crossing to each other
im afraid so, but also it can be easy to find the errors or tricky
when its obvious the chosen route is way longer you can spot them quickly, then zoom in and see theyre not touching
ill probably move on to the geocoding tho, i want place names
so recently i noticed that the devbranch version of my website loads a bit slow
i was thinking for a bit until i remembered that i recently set up a bot that records all conquest events and also records war reports once a minute
and then the website gives the data to the user for different kinds of stats
so anyway
this is a typical event
there are 1636 of these
what an unit
and this is a typical war report
recorded once a minute
there are 3044 of these
the total size of json was 7 mb
fuk
ever considered condensing it to a flag bite?
just one row 7mb ?
no, all of these 3044 rows of war reports plus 1636 events is 7 mb
all this bullshit that this one request gives out
7mb meh
just shorten all the names lol
or use ids
Select "Wardens" -> Replace "W"
idem for Colonial and Neutral, and you can cut half an MB
in fact, store them as 2 bits
@languid harness well there is a third team called None
but heres the thing that i found really slowed down my db interactions,
Yeah, as I said neutral
hence 2 bits
00=none, 01=colly, 10=warden, 11=scorched
so anyway
scorched is a flag not a team
i just replaced colonialcasualties, wardencasualties and totalenlistments with c,w and e
file size dropped from 7 mb to 3.83 mb

the next step is replacing region names with region ids
becarefull not to create too short of handles
the problem is that war report json doesnt give out region ids
otherwise you wont remember what they were
thats what readme is for 
it does give out ids
or become hard to find in scripts to read
its in the other endpoint
I personally use the first few letters, e.g. ColCas, WarCas; keeps things compact but very readable
although python is generally all for readability
lets ask casey to change the /maps/ endpoint
right now its just an array of possible endpoints
what it should be is a list of objects with 1) endpoints for war api 2) region ids 3) region names in the game
in an ideal world yes, but its workable the way it is so i doubt it will be a priority but ask if you want, that is what github is for
so is your site still slow
@barren quarry
oh im gonna have to wipe the database and start from scratch
is your site still slow ?
yeah it is because the changes that im making have not really applied yet
is it just doing inserts ? any selects or updates ?
ok so there are three things
there is a glitch project that records the events and war reports which im working on
then there is a copy of this project on a dedicated server provided by Nooba to me & seth
then there is a devbranch version of foxhole global that pulls the json data from nooba's server and feeds it to users
right now im making changes on the glitch project
and making sure it works correctly
which is the one running slow ?
the devbranch version of foxhole global is running slow
on the front end
because the user has to load all this massive data that is relayed from nooba's server
so it takes like 11 seconds to load the page
so your big db is on noobas, and then you have a 'global' devbranch pulling data from there
yes
the big thing for me to optimise my db selects for the user, was to make sure and selects WHERE clause utilized a primary id field if the table was a big one
so what i had to do was split of my records into two tables current war and all past wars, so the current war table which is always going to be relatively small can have selects not by primary id such as by time period ok, and then past wars have their start and end primary id saved ina seperate index table that i select from to then use in the query to select the selected war rows from the big daddy all past
wars table
how big is your past wars table
thats not very much
i did optimse them recently down from around 160mb
and 1.6 mil rows
i dropped all my skirmish & devbranch data
and fields that where not needed anymore
i think that when you're storing data from past wars you dont really need the "none" -> under construction data
because nothing is really accomplished in this event
so my events table is not even that big, i didnt mention that
i could easily make ids for all those commonly used terms to further small my tables
all past war events is only 150,000 rows 13mb
the big thing like i said is number of rows and if you are using primary/unique ids for lookups, it can make several seconds difference in query time which really ads up when you have a lot of users
Alright, I have been fighting with this issue for quite a while now, so I just better ask it here and see if one of y'all can fix it:
I have a Raspberry Pi Nano W, which runs on Rasbian in a lite installation. I want to connect to a Github. To do so, I followed all the steps in this tutorial: https://projects.raspberrypi.org/en/projects/getting-started-with-git/10 . However, I am unable to use git push -u origin master, which yields the error:
fatal: Could not read from remote repository
Please make sure you have the correct access rights and the repository exists.```
I find this very annoying. I have done everything I could think of to connect this fucker up, but I fail every time. The SSH-keys are never right and I have not found a way to actually log in via my RP into (one of) my account(s).
help
have you created a repository on your github account?
yes
hm, i only have experience with github desktop
@languid harness you might need some keys installed or packages, just keep googling or stack
but I am tiiiiiiireeeeeeed
go to bed, sometimes its amazing how quick you work something out after a break
I have been taking breaks fro this past few weeks
it is not just a random problem that ocoured
I have been fighting with this for half a month now
have you tried pushing to repo from another pc
its a windows 10, but worth a shot
@zealous sonnet !!!! Bug in api /war is reporting WC number as 34 already but 34 has not started yet !! REEEEE π¦
@barren quarry @keen dome
you don't need to ping everyone for that
my poor database πΏ
is the war id the same as before or did that also change?
lmk
rip
its the same
ok i'm probably going to remove warNumber from the documentation until it's fixed
@languid harness, are you intent on using ssh to connect to git? you can just use the https address instead and get around the whole ssh key thing. I haven't done ssh for git in a while, do they want you to generate a private/public key and upload them the public key?
well, they want me to do all kinds of things? The only thing I want is being able to download a .git and run that shit
I felt like the SSH was the right thing to do, as it actually grands access to an account to a certain extend contrary to just having a name and email adress
ssh is the hard way, just use the https:// link for the git repository instead, it will just prompt you for username and password, its waaaaay easier
and roughly as secure
otherwise, i would guess the piece your missing with ssh is setting git to use the private key you generate for the remote (on your side)
well, I made the key on the Pi and then typed it over to the site on ym laptop. It gave errors that it was the wrong type of SSH, which I clearly made sure it wasnt several times
github said it was the wrong ssh type?
hmm i get the same thing
ah, so make sure you're generating an OpenSSH key, not ssh.com. It should start with ssh-rsa
i had issues connecting to my github through my university servers a few months back. had to turn off 2FA
@long raft it does start with ssh-rsa
idk anymore
and doing this via windows is a pain in the ass; when I download github, it doesnt give me the shell, so I cannot follow the dang tutorial reeeee
can you just use the https link? still not clear if you have to use it
that one is easy, just git clone https://github.com/NoUDerp/Tiler and it's done
yes and when you go to push it will need your github user and password
and then it will remember it...
lit
darn
@long raft aaaaah! you did it!
now adding a script to get all the modules lol
yea you can even encode the username and password (not that it's a good idea...) into the https url
hehehehe
sounds likes a lot to fuck up
although I must state that I have to log in every time I do a clone
that being said, I have it almost working
like really close
it jsut doesnt want to instal certain packages
What isn't installing packages?
pip
he can isntal some
but not all
prolly a me issue tho
anyhow, I am free all of tomorrow because I was a too effective worker so I will be fixing it tomorrow
because this doesnt seem like a real issue, something I can fix either via cmd or by rewriting my script as I dont remember what half of it is used for
(((or used at all)))
thanks anyway Derp, helped me a lot
ah, so some of pip libraries dont include the binary for your architecture, the arm v6 i guess it is
some of them cant be installed, and others probably need to be compiled from source - so you will likely need to apt install build-essential, maybe any other libraries you need for compiling those packages, sometimes you just have to keep trying to push it through and solving the next missing dependency
Is there any way to get the "time until" next war from the API? I.e. the value you see in Home Region -> Travel Tent right now
or should I just hit war data endpoint every 60 secs until war id changes?
we are getting data from maps that supposed to be offline. @zealous sonnet
that in theory is not an issue, but there should be an input that says they are 'offline' too. Otherwise we would have to set those regions offline manually
hey, please open a github issue and we'll fix it when possible
@young pilot @barren quarry @pure sierra did any of you create an issue?
If not I will in a few hours
i did an hour ago
im awake
good day
old bug still not fixed already reported by me...
this can bee confirmed by seeing that in game lobby it still reports day 192
hm, my RP has issues installing Pandas it appears; it can find and download it, but then it just stops...
(((a bit hard to read, sorry, but the best photo I could take)))
Like, it had been running for at least 30 mins, every time to no avail
Gonna let it run longer this time because I have to do other stuff, but its very weird that it would give no feedback on it status unlike the other packages do
any one notice the required victory towns for this war change ? wasnt it 16 b4 ? now its 15 ...
or am i wrong ?
it was 25 when the war started.. now it's changed ti 15 :S
omg, it has been nearly 2 hours, and it has made progress lol
Probably gonna help you
https://raspberrypi.stackexchange.com/questions/17073/how-do-i-install-pandas-on-raspberry-pi
"Pandas relies on numpy which can take an extremely long time to build, even on a very fast desktop machine."
oh god
I thought it may have been the heat, its like 30 degrees inside and the thing is boiling hot
and it is nano as well 
hi im working on a video playback of the control map to view history, it would be a link ner the current map saying like "replay map history", do you think it would be better or make more sense to have the video order play in reverse from the current situation backto the start of the war ? or say from some time in the past such as the start of war or 5 days ago forward to now ?
(i will be making the playback speed a bit quicker too)
How I'd view it is 'okay what has happend last 5 days and how did we end up here' then I'd see each day progress and come to the current map so I could go forward from there.
If it's reverse order it's like.. 'okay this is the map now, lets see..' you'd see what has happend and at end be like 'oh yeah this is how I left the map.. wait what to do now' :D
Woul be also nice if you could decide if you want to see 1d / 7d / 30d some hacky timestamp jump or such always have the videos at same lenght and timings so you can do it, or just make bunch of viedos :D
I guess we first need foxhole wars that last that long too.. one can always hope.
Like someone could be off on weekend and unable to play so it's nice to view during that how the map evolved
yo
yo
yo
yo
yo
yo
yo
yo
yo
Iterations exceeded. The recursive function has been terminated.
c-c-c-combo breaker
oh stonecradle today.... πΏ
What happened
@pure sierra i met you on the bridge yesterday
really, ? you should have said hello, or ify ou didnt i didnt recognise you
typical warden dying on a bridge
but not on the bridge
hayden kills warden flatbeds for fun π¦ I saw him use one on the front line.
The poor easily disabled yellow vehicles π¦
looks cool
moved the text up top to not be obstructed by the player track bar (active on new images from now)
hey i got this thing i want y'all to check out
have geocoding figured out
mmm javascript not a pleasant experience but im through most of the tough parts
yeah, it lacks
So er, can we have trains now?
hey guys
I'm working on a text videogame thing and I keep running into "I should do it this way, but oh gosh what if I need to do it some other way later"
in the end nothing or barely anything gets done
I was wondering if anyone has had encounters with such things and could offer some advice
redoing stuff you already did is called refactoring
its absolutely normal and is part of development process
I see
before you do it the right way you have to do it in some way first
That's true, but these thoughts still kind of, you know
interfere with the work process
That's my issue to deal with at that point though, I appreciate the insight a lot
Sometimes you can spend so much time on thinking "is this the right way" that you don't do it any way
that's what seems to be happening now
there's this issue I'm facing right now
the game needs to load from json files
and it does, there's a piece of code that loads json files and processes them into in-language objects
but what then
do I just hardcode lists of objects to paths where their respective JSONs reside
And a third thing that I find frustrating
"if you code a little every day, you'll develop a habit and be productive"
I believe the habit thing, but I don't believe the productive thing
why
why what?
refactoring is completely normal π
why dont you believe the productive thing
Happened a LOT when I did my text based story game on Java in high school
maybe I'm just lazy, but it's very difficult for me to believe hyperproductivity
I think to all the times where several days of productivity end up absolutely murdering anything that can be done for the next few days, for me
And then at day 4 or 5 I start being very critical of myself for not "keeping up the good work", and then that spirals out of control
just feels like an impossible thing to attain
constant productivity by habit
honestly, maybe it's a personal thing
maybe I just work in short bursts
why do I feel this is going to be my life when college starts
hyperproductivity is not a thing
alright
though, I still want to figure out
how to organize loading data from config files and properly organizing it for inter-program access
put the json files into a folder
got that done, yeah
make it so it checks and parses all files in the folder
it does that
then what else do you want
but where does it put the objects created during parsing
how do other parts of program access it
do I make a big
array
associative array of them
what programming language
python
ok this is not my area of expertise
understandable, I appreciate it the help a lot anyway though
@long raft could help i think
even just by, you know
rubber duck programming
if I explain my woes here, I might accidentally get a big understanding of them
im going to explain the stuff i did with my project foxhole global, idk if you heard about it
I wouldn't mind
there is a plugin in javascript called React Redux
basically its a fancy way of managing global variables
alright, makes sense so far
you have a store which is a root object
and the properties of the store are other different objects, like user data, or map data, or events
then you subscribe the website elements to keep track of when these properties changes and update when they do
does anything in store or its children get new objects created or removed dynamically, at runtime
like, if store has an object for map data
and that map data object keeps track of things like, I dunno
cities, forts, salvage fields, mines
does it only track changes of these four things - cities forts salvage fields and mines
or is there functionality for new things to be added while the program is running
because this is an issue I'm having
do I hardcode things to be tracked
or do I allow for them to be changed without changing code, and if so, how
honestly though, after this discussion I'm starting to think that I should just make it work how it is now, and build on top of that, and redo it later if I need to
this is how i implemented this:
a user initially loads a map with towns, forts and stuff
the server sends requests to foxhole api to check if the data has been changed, every 3 seconds
suppose the data has changed, like a town has been captured
the server sees the new data and downloads it, saves it to the database and then emits an event to all online users with new map data
a store event happens which puts in the new map data
by default, the React components update when there is a new state (internal variables) or props (variables passed down to component from its parent)
but we dont want to always update the icons whenever there are changes in data because there are ~580 capturable locations and also mines and resource nodes, so we write a function that checks whether the data we pass for this icon is actually new (realistically when an event happens, only 1 icon out of 580 is changed, right?)
nobody wants to write the code for comparing all properties of an object especially when are several hundred of them, so we just turn both objects into a string and compare them as strings, if there are differences then we update
I may be wrong, but wouldn't it also make sense to bundle the thing that changed with the "recheck everything"
Honestly it probably would, but an implementation detail stopped it or something
but actually what i wanted to talk about more is productivity in general because this thing took me 3 months
if you try to commit all of your time into making this thing you will quickly burn out
you can afford it if your project is small enough that you can finish it in under 2 weeks
this is why I wanted to bring up this "code a little every day"
it just feels like such a "crush your soul at home diy project!"
but yeah
thanks a lot for this conversation
the insights of the fact that others do struggle with things that I struggle with are calming
- keep everything as simple as you can until you need it
- create a punch list of outstanding tasks
- drugs. illicit or caffeine
derp
yes, task lists are absolutely important
nah python probably my weakest language
well fuck
understandable
i basically just read it
if i were applying for a job that needed a python programmer - sure, i know it. but between you guys and I, im like a 1-2/10
can I try to ask anyway
i hate interpreted languages as much as i hate anti patterns
understandable
here's the thing though
so I have config files, json
that define various in-game objects
the objects are pieces of furniture, items, rooms, and finally "buildings" which are just multiple rooms
I don't know of, well
how I'd like to access these things in code
and to make sure everything is extensible is neat
do I want dot notation with stuff like
data.buildings
do I create objects at runtime for each entry in the list so I can do stuff like
data.furniture.table
but what if I have multiple tables, they'll conflict then
honestly should probably settle on SOMETHING that WORKS at least in theory
and then write a bit of code to be able to understand such a request
and fetch the appropriate thing
{buildings:[ {type: "table", x:..., y:...}, {}, {}... ]}
dont be afraid to use arrays in your json i guess...
well you cant avoid hardcoding everything, or else youre just building some insanely complicated json parser
if I have buildings one moment some other day program doesn't know what 'buildings' are
this may sound very retarded but i suggest using folder trees and putting each object in its own json file
at some point the rubber meets the road
that's very far from retarded
and it's quite far from what I'm doing
my problem is
having the rest of the program fetch objects
if it internally knows of folder structure
and I change it
i spent my teenage years making game engines for games id never finish
and I end up having to change it in hundreds of places after that
I'm very
very
fucked
dont get too tied down in the scope of an engine, having interactive program is more important than the data design
absolutely
though, you know
easier said that done
maybe I'm just perfectionist to the point of my own harm
if it were me id just hard code whatever i have in my, and then put on the punch list remove hard coding
its like ... spending days farming the mats for a tank only to run over a friendly mine instantly
yeah, that's true
it's a good point
to make something THAT WORKS
instead of something that looks great but doesn't work
youre more likely to stay motivated that way, in my opinion
if you can constantly show people demos and stuff...
I'm currently dealing with a complex system that won't work until at least 4 sub-systems are functional
and it's absolutely
killing me
you can fill in a lot of place holders for stuff
