• What are you working on? v67 - March 2017
    3,527 replies, posted
[QUOTE=BummieHEad;52634291]Working on this live map of transport lines in Oslo. Guessing the positions based on real time data from the transport company. The data says how many minutes until the arrival of the bus/tram/train. [video=youtube;P5JYAn6uW5k]https://www.youtube.com/watch?v=P5JYAn6uW5k[/video][/QUOTE] If you want more precise route paths, you may be able to copy some of that from [URL="http://www.openstreetmap.org/relation/5400026"]here[/URL][URL="https://archive.is/juw7W"].[/URL] I haven't checked how well the license meshes with a GMaps overlay and it would probably be overkill, though.
[QUOTE=BummieHEad;52634291]Working on this live map of transport lines in Oslo. Guessing the positions based on real time data from the transport company. The data says how many minutes until the arrival of the bus/tram/train. [video=youtube;P5JYAn6uW5k]https://www.youtube.com/watch?v=P5JYAn6uW5k[/video][/QUOTE] I did this exact project in my area :P
[QUOTE=Sam Za Nemesis;52635585]While I'm on a brain cool of my main hobby project I've worked on a quick physically based raymarching renderer with my friend [t]http://image.noelshack.com/fichiers/2017/35/5/1504231615-untitled.png[/t] Does anyone have any documents on generating good RNG?[/QUOTE] Not really a paper per se, but check out xoroshiro128+. It did pretty good in my OpenCL-based pathtracer.
[QUOTE=Tamschi;52635814]If you want more precise route paths, you may be able to copy some of that from [URL="http://www.openstreetmap.org/relation/5400026"]here[/URL][URL="https://archive.is/juw7W"].[/URL] I haven't checked how well the license meshes with a GMaps overlay and it would probably be overkill, though.[/QUOTE] Did not know about this, thanks! I will take a look into it.
Learning 8080 assembly with [url]http://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf[/url] and [url]https://www.tramm.li/i8080/emu8080.html[/url] I modified the Hello World program and wrote this [img]http://i.imgur.com/njWSicq.png[/img] I guess as a corollary, I'm learning CP/M?
[QUOTE=Icedshot;52635401]Ohh boy, here I go networking multiplayer games again! [media]https://www.youtube.com/watch?v=Ygjge3nstAI[/media] Things that work: Packet fragmentation, reliable packet delivery (mostly), packet sequencing Networking entire game state (very slow) AKA try massive packet Networking parts of the gamestate in a reduced way (very fast) AKA try mini packet Only networking parts of the gamestate involves defining a separate serialisation function just for stuff that needs to be networked, as well as informing the serialisation system that it needs to skip serialising pointers (as they only ever point to other serialisable datastructures that will be sent in a separate update) This is pretty rocking because it means the fundamentals are all there. The next big step is dynamic object creation/destruction, and ensuring that the clients gamestate doesn't go into invalid territory while we're updating it with packets. This will likely be fixed by requesting a big chunk of data when something gets destroyed and just waiting for it to all filter in Gamestate serialisation also needs to be done gradually rather than all at once, so when something major happens (new empire) and we have to sync tonnes of shit, the game doesn't just freeze. That's much later though[/QUOTE] use delta compression and look into declaring your object variables as explicit syncables, that way you avoid sending bad data (and avoid stupid shit like serialising memory alignment padding). see: [url]https://developer.valvesoftware.com/wiki/Networking_Entities[/url] [url]https://github.com/Silentfood/project-f/blob/master/Game/Shared/CubeEntity.h[/url] (self promote)
[QUOTE=Silentfood;52641446]use delta compression and look into declaring your object variables as explicit syncables, that way you avoid sending bad data (and avoid stupid shit like serialising memory alignment padding). see: [url]https://developer.valvesoftware.com/wiki/Networking_Entities[/url] [url]https://github.com/Silentfood/project-f/blob/master/Game/Shared/CubeEntity.h[/url] (self promote)[/QUOTE] This is pretty much what I've done, except I define networking as [cpp] void orbital_system::do_serialise(serialise& s, bool ser) { if(serialise_data_helper::send_mode == 1) { s.handle_serialise(toggle_fleet_ui, ser); s.handle_serialise(accumulated_nonviewed_time, ser); s.handle_serialise(highlight, ser); s.handle_serialise(asteroids, ser); s.handle_serialise(orbitals, ser); s.handle_serialise(universe_pos, ser); s.handle_serialise(advertised_empires, ser); } if(serialise_data_helper::send_mode == 0) { s.handle_serialise(orbitals, ser); } } [/cpp] Where 1 is for full updates (on create), and 0 is for partial updates. This means I can avoid decorating random member variables on class declaration, and it makes it much easier to debug. This handles pointers and containers seamlessly as well, and you never need to decorate the type as its all figured out under the hood (unless you want to, in which case you can pass it as a template parameter) Classes that don't inherit from serialisable are simply inspected as (char*) pointers which means you may get some alignment (although the classes I use this for are generally pod types with no padding), and every pointer has to point to a type which inherits from serialisable in order to function (although I think its fairly trivial to lift that restriction). Anything which inherits from serialisable is serialised throuhg a do_serialise method. There's two modes in this as well which is follow pointers, and don't follow pointers. In follow pointers mode, every pointer + data is followed through and serialised (with a simple scheme to avoid cycles, a pointer table). In non follow pointers mode, the data of pointers isn't serialised, just a reference which represents the pointer. On top of this, pointers can be dirty. If the serialisation graph is being traversed (say we're looking at orbital system and encounter an orbital pointer) and we encounter a dirty pointer, the pointer + data is serialised. This means you can set a group of related objects which have interdependencies to be dirty, and they'll be sent as one contiguous update avoiding inconsistent state problems So you can take a complex object like an orbital system, and network it initially in mode 1 with no follow pointers. Itll send the full data of the orbital system across, like asteroids, where it is in the universe etc. Then after that, you only update in mode 0 (with no follow pointers), which will update per tick information about the system (currently not really much). When a new orbital is created on player 1, it is marked as dirty (and any associated fleets that are created with it are also marked as dirty). Next time the system networks, itll look at all its orbital pointers (in the container) and notice that one of them is dirty, at which point it will serialise it. If the orbital has a fleet pointer, it will also be dirty and that will be added to the serialisation stack. If the fleet has ships, they will be marked as dirty and added to the stack as well. This stack represents one complete packet, which will get dynamically fragmented under the hood On the other end, the serialisation id of the system is part of the networking protocol, so I lookup the object based on the id we got and the host id (creating it if it doesn't exist), and then perform the reverse of the above This overall works pretty well for me. There were some nuances to get shared ownership of containers to work, which made me have to introduce a mode 2 where you declare delta changes to containers, but overall this works fine. I can get away with relatively infrequent object updates (its slow paced co-op rts), so I'm skipping delta compression and will probably just stuff the relatively large packets I have into lzma which seems to get about a factor of 10 compression ratio. I'm actually currently bottlenecked by the fact that my network receive isn't threaded :v: [url]https://github.com/20k/4space/blob/master/serialise.hpp[/url]
[QUOTE=Quiet;52610800]And here I am, waiting for Microsoft to implement even C99 (let alone C11) :v:[/QUOTE] Use Clang. It supports .pdb now as well so you can even use Visual Studio to debug. See [url]http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html[/url] , you'll need a snapshot build I think. EDIT: I realise I'm a week late... but having proper Clang support on Windows is pretty cool anyway?
[URL="https://facepunch.com/showthread.php?t=1425247"]3 years ago[/URL] I made a thread asking for help to extract model data from the .i3d.shapes format used in the GIANTS engine (used by Farming Simulator). I succeeded in decrypting the data and at roughly the same time [URL="https://facepunch.com/member.php?u=60704"]high[/URL] comes around and also has a working code but much neater than mine. However things got in the way and I never finished it after that. I've been bugged by several people for 2 years now to finish it and today is the day! [IMG]http://f.donkie.co/ASx75[/IMG] Man it feels really good to actually have something displayable. It's written in C# and uses AssimpNet to export to various 3d formats. However what bothers me abit is that there seems to be no smoothing on the output models. I don't really know much about modelling, is this something the model file should take care of (i.e. the extraction failed abit) or does the engine fix this itself? [IMG]http://f.donkie.co/77370[/IMG] Anyways here's the project: [url]https://github.com/Donkie/I3DShapesTool[/url] Gonna spend some time cleaning it up and making it useful now :P
[QUOTE=Donkie;52646306] However what bothers me abit is that there seems to be no smoothing on the output models. I don't really know much about modelling, is this something the model file should take care of (i.e. the extraction failed abit) or does the engine fix this itself? [/QUOTE] A model is just a set of triangles and their normals. If you want smooth models, you have to interpolate the normals between each tri's center. 3D-Modelling software usually has a checkbox somewhere to enable or disable it. So the model you extracted is in fact correct.
More networking. Now fleets and ships are networked (including the ships internal stats like hp, warp etc), as well as dynamic changes to orbitals/fleets (splitting/merging fleets, adding new ships etc). The only major system now which isn't networked now is battles, which potentially need a rework to fit them into the existing networking system [media]https://www.youtube.com/watch?v=ye6vjaQOP5kp[/media]
My Complex Networks paper was accepted by an international congress, wish me luck [editline]5th September 2017[/editline] I'm stocked af
Would you guys say the kinect camera is the best option for fiddling with when it comes to capturing images from it and detecting shapes (and maybe depth) or are there other options? I expect the kinect camera to be locked to Windows (or worse Windows 10 only). Ideally looking for something platform agnostic, but maybe a regular webcam could suffice, but I figured the Kinect or the PS Eye have decent apis to go with them. Edit: The more I think about it, the better a webcam sounds, so I think I just answered my own question. :v: Edit #2: Actually I take that back, the kinect has open source libraries that are platform agnostic and stuff but it seems to be very hard to get your hands on a kinect 1.0 for PC. If I remember correctly the 360 ones don't work on PC?
[QUOTE=JohnnyOnFlame;52649645]My Complex Networks paper was accepted by an international congress, wish me luck [editline]5th September 2017[/editline] I'm stocked af[/QUOTE] That is rad man! Are those complex valued neural networks?
[QUOTE=Sam Za Nemesis;52651002]I am happy for you, you can use it as your golden opportunity to get out of this god forsaken country[/QUOTE] Unfortunally I don't have $ to go defend it alongside of my lecturer :( [editline]5th September 2017[/editline] [QUOTE=Fourier;52651665]That is rad man! Are those complex valued neural networks?[/QUOTE] Nah, it's a rather simple analysis of the behavior of social networks in github [editline]5th September 2017[/editline] Using complex networks ofc
We're writing programs in c++ for PLCs and other industrial stuff in one of my courses and my first lab of this term required my professor to spend 3 hours learning new concepts in C++ he didn't know. lol He wrote me half a page on my grade sheet about how while he was impressed, he wanted me to tone down my programs to something much more basic and in tune with the average of the class. I'm still not sure if I should apologise to him or not.
[QUOTE=F.X Clampazzo;52652081]We're writing programs in c++ for PLCs and other industrial stuff in one of my courses and my first lab of this term required my professor to spend 3 hours learning new concepts in C++ he didn't know. lol He wrote me half a page on my grade sheet about how while he was impressed, he wanted me to tone down my programs to something much more basic and in tune with the average of the class. I'm still not sure if I should apologise to him or not.[/QUOTE] What concepts did you use that he didn't know?
Still working on my municipal election data map, but ended up scrapping the voronoi idea since I couldn't get it to generate nice ones. I also had issues pre-generating the polygons and then just translating them upon zoom level change, which made zooming a little laggier than I would like. This turned out to be a happy little problem, because I started looking into using OpenStreetMaps boundaries for the municipalities instead of voronois and it instantly made the map so much nicer to look at. I also switched from Google's API to an OSM tile provider, which was surprisingly simple. I also started processing the raw 10MB election data file as well as the fully detailed boundaries for the municipalities to cut the size down, meaning the complete dataset including election and map data is about 2.2KB and requires no javascript postprocessing to render. You can see a live demo of it [URL]https://kmv2013.pius.io/[/URL] Or browse the repository at [URL]https://github.com/MathiasPius/KMV2013[/URL] [img]https://kmv2013.pius.io/demo.png[/img]
[QUOTE=JWki;52653121]What concepts did you use that he didn't know?[/QUOTE] We were making a program that was supposed to track and sort boxes by various properties using sensors. So I wrote a multithreaded program( the brain of the hardware we tested on is a rasberry pi. So we had Quad core cpus to work with.) that considered each box to be a member of the box class, I then stored those boxes in a map and each time a "conveyor" moved a specific distance it would output 1 so I used that as a clock signal and each tick all boxes would update their location and if they were to be moved off the conveyor they would be "moved", counted into their respective completion count variables and flagged as open in a companion array that kept track of the map's usage. Each time a box was created it would reference the array and fill a slot in the map. He didn't know anything about threading or maps. He intended for us to use arrays completely and I guess process boxes 1 at a time? It was weird because he said, "I know our example is only 10 lengths long but think about if your system was much longer, like a whole factory."
[QUOTE=F.X Clampazzo;52654111]We were making a program that was supposed to track and sort boxes by various properties using sensors. So I wrote a multithreaded program( the brain of the hardware we tested on is a rasberry pi. So we had Quad core cpus to work with.) that considered each box to be a member of the box class, I then stored those boxes in a map and each time a "conveyor" moved a specific distance it would output 1 so I used that as a clock signal and each tick all boxes would update their location and if they were to be moved off the conveyor they would be "moved", counted into their respective completion count variables and flagged as open in a companion array that kept track of the map's usage. Each time a box was created it would reference the array and fill a slot in the map. He didn't know anything about threading or maps. He intended for us to use arrays completely and I guess process boxes 1 at a time? It was weird because he said, "I know our example is only 10 lengths long but think about if your system was much longer, like a whole factory."[/QUOTE] I'm really [I]really[/I] tired of hearing about how absolutely fucking wretched C++ teaching is: it is embarassing that what you did is considered far beyond the professor. What you did was clever and effective, and I don't mean to demean what you did, but it should be something that the professor nods along with as "ah, effective use of the language!". The usual bullshit excuse given is that "no one in the industry uses it" or "embedded systems can't run it". Uh, fuck no. We use C++11/14 in part of our radio system backend: comprised partially of PLCs + a quad-core SoC (I'm not even going to be able to cover how much easier using an RTOS or threading is with C++). Because of our operating environment we have to be a bit cautious about what features we use (mostly with an eye on binary bloat), but things like std::array and unique_ptr give us arrays and pointers without risking memory management issues (and with no real overhead to speak of). constexpr is much lovelier than macro abuse, classes with constructors and destructors are better than how you kludge that in C, and as a whole effective usage of modern C++ in an embedded system makes life [I]vastly[/I] easier AND [I]increases[/I] safety of the code (so long as you use the right things). That all being said, there are codebases that epitomize what your professor is likely thinking of as the usual. This usually comes down to upper management or managers not using modern C++ because of hearsay and unfounded worries, or because they weren't ever taught it in school either. its kind of a vicious cycle: newer stuff isn't taught because it "isn't used in industry", newer stuff that was never taught isn't used in industry because its not been learnt, this propagates back down to a curriculum, etc I nearly screamed when my boyfriend said they just weren't [I]allowed[/I] to use C++11, with no reasoning given, and that templates had not even been covered despite the fact that he's a fucking junior taking his third C++ class. [sp]also all of this is undoubtedly biased since I've never taken any real programming courses, and am entirely (poorly) self-taught[/sp]
What I did was pretty much bog standard I totally agree. That's why I was so fucking confused. The only thing that was maybe a bit outside the scope of most process control was multithreading because im sure a lot of stuff is still single core low power hardware. They bought Rpi's. Quad core Rpi's. And we're not even going to cover how that's a huge fucking deal for programming in this environment? This is a junior level PLC class. Doing all I did with one thread could fail on a large implementation where im tracking thousands of boxes across a whole factory. Miss one conveyor cycle and your boxes are absolutely fucked and not getting sorted right. That's a potential thousands of dollars in problems.
I'm experimenting a bit with A-Frame, so here's a wallpaper: [t]http://i.imgur.com/qUyJTXj.png[/t][code]<a-scene> <a-entity environment="preset: checkerboard; groundYScale: 100; dressingAmount: 100;"></a-entity> <a-log position="0 3 -4" geometry="primitive: box"></a-log> <a-entity camera look-controls wasd-controls="fly: true" position="0 2 0"></a-entity> </a-scene>[/code] The environment is [URL="https://www.npmjs.com/package/aframe-environment-component"]this[/URL][URL="https://archive.is/8fiVt"],[/URL] and the monolith is [URL="https://www.npmjs.com/package/aframe-log-component"]that[/URL][URL="https://archive.is/Cl0rX"].[/URL] Normally it would display a bunch of debug output of me trying to get controller input to work, but I haven't yet figured out how to do that from Kotlin :pcrepair:
[QUOTE=CommanderPT;52651645]Would you guys say the kinect camera is the best option for fiddling with when it comes to capturing images from it and detecting shapes (and maybe depth) or are there other options? I expect the kinect camera to be locked to Windows (or worse Windows 10 only). Ideally looking for something platform agnostic, but maybe a regular webcam could suffice, but I figured the Kinect or the PS Eye have decent apis to go with them. Edit: The more I think about it, the better a webcam sounds, so I think I just answered my own question. :v: Edit #2: Actually I take that back, the kinect has open source libraries that are platform agnostic and stuff but it seems to be very hard to get your hands on a kinect 1.0 for PC. If I remember correctly the 360 ones don't work on PC?[/QUOTE] I'm pretty sure the 360 Kinect does work on PC, you just need specific drivers from Microsoft. I think this should do it [url]https://www.microsoft.com/en-us/download/details.aspx?id=44559[/url]
[QUOTE=buster925;52654718]I'm pretty sure the 360 Kinect does work on PC, you just need specific drivers from Microsoft. I think this should do it [url]https://www.microsoft.com/en-us/download/details.aspx?id=44559[/url][/QUOTE] It has a proprietary power+data plug, for which you need an adaptor to usb+transformer, which iirc are inexpensive. [editline]6th September 2017[/editline] Yup: [url]https://www.amazon.com/kinect-adapter-xbox-360/s?ie=UTF8&page=1&rh=i%3Aaps%2Ck%3Akinect%20adapter%20for%20xbox%20360[/url]
I found a bug in MSVC, by working on a generic "TaskPool" of sorts that lets me execute arbitrary tasks on another thread. The method for adding a task to the pool is C++ template silliness, but it lets me use just about [I]any[/I] arbitrary function as input, and returns a future for the desired item to eventually output into. [cpp] template<class Fn, class...Args> std::future<typename std::result_of<Fn(Args...)>::type> AddTask(Fn&& f, Args&&... args) { std::packaged_task<typename std::result_of<Fn(Args...)>::type()> task(std::bind(f, args...)); std::future<typename std::result_of<Fn(Args...)>::type> result_future(std::move(task.get_future())); std::lock_guard<std::mutex> queue_lock(queueMutex); TaskQueue.push_back(std::packaged_task<void()>(std::move(task))); cVar.notify_one(); return std::move(result_future); } [/cpp] This is intended for my terrain stuff, and improving how I stream terrain while I figure out how2computeshader: when a terrain node is created, it adds the task to generate its height data to the task pool and stores the returned future. during the quadtree walk, each node checks to see if the future with height data is populated: if it is, there's another task pool for generating mesh data and transferring it to the GPU. once that's complete, the node is added to the render list. There shouldn't be any hanging while waiting for things to load, as nodes will "pop" in as soon as they're ready. This is all theoretical, though: I can't test it, really, as my code is currently only compatible with Windows. I've tested the task pool in GCC and it works, though, so once I figure out why MSVC hates my code I should be able to test this (oddly, I can submit lambdas: just not actual functions of any kind). Pretty satisfied with how this turned out, though, as the little test cases I've run in GCC have been lovely since its so easy to add tasks to the pool and just let it run in a background thread. [editline]edited[/editline] extra fun part of the bug: its an error that says I'm trying to use the copy constructor of std::packaged_task (which doesn't exist), despite explicitly using std::move. This is a bug that was previously fixed once already a few years ago lol
[t]https://puu.sh/xtfh5/b84bef3c47.png[/t] Doing some UI/editor work, just finished up a first version of multiselect so you can ctrl+click to pick individual entities to select as well as shift+click to select ranges of objects. Also made translation gizmos work as expected for multiselections, kinda have to implement quaternions now to be able to do the same for rotations. As a nice sidenote, almost all of that was implemented without having to close the app, except for when crashing it occasionally, as the entity explorer and property editor UI live in their own module that can be hotreloaded. This is only the start of me pulling this massive block of code apart into nice little self-contained units, at least that's the plan. Really have to start working on high level rendering and asset systems so I can scenes that don't consist of a thousand instances of the same model. EDIT: Oh and almost forgot, I also implemented copy operations for entities, which, thanks to my entity system being as simple as it gets, boiled down to like ten lines of code: [CODE] Entity CopyEntity(World* world, Entity entity) { Entity newEnt = CreateEntity(world); if (newEnt.id != INVALID_ID) { EntityData* from = world->entities.Get(entity.id); EntityData* to = world->entities.Get(newEnt.id); assert(from); assert(to); memcpy(to, from, sizeof(EntityData)); } return newEnt; } [/CODE]
Testing my computation graph library by training an LSTM to predict the Bible, the results are pretty great: [quote]44:7 The LORD shall save me with a man in thy work. 41:4 The LORD hath seen me, O LORD, and his soul be glad, and all that thou sanctisest thy face. 41:14 But thou hast seen me: let them be ashamed. 41:11 Let them deliver me in my hand, I will be put to them that despise me, and thou saidst, I am an hore to the work, and set me up against me, and so wise unto me, that he did for the waters of the house of the LORD and the LORD. 44:14 My soul is the mountain of the head of the LORD, and thou hast strengthened me for the hand of the LORD, and all the days of my heart they trust; and I will seek thy mouth to thy transgression.[/quote] [quote]4:1 I will see your mystery that I should be astonished of the high priest, and in his saints be dead. 4:19 I am no man's spiritual commenders in Christ, and for the world which is accepted, and are the high priest, and the spiritual with the poor winds of the wise of the sea, and to the wise of God. 4:14 For we have every man wise that is man of God are thereon, but in the law, he that was accepted of the world by the law, and that things which is for the Lord shall be at Jerusalem, and the scriptures of the Lord. 4:1 Now I say that they are more than any meat of the company of God. 4:14 And the Lord is grace to the righteousness of God, and who are the prophets, and in the prophets. 4:14 For the Lord is wise in the Lord, that I may be the name of God, and by the wise that they which we would not be of the law. 4:33 Then saith the prophets, Create and the ship, but be the name of the Lord. [/quote] Each quote block is a continuous sampling from the network, using a softmax temperature of 0.5. The LSTM has a single 512-unit hidden layer, and was trained with backpropagation through time using a sequence length of 50 characters and Adam optimization with a learning rate of 3e-3. I think all that (processing) power is getting to its head: [quote]3:22 Therefore shall I be a prophet to destroy all the people of the land.[/quote]
[IMG]https://i.gyazo.com/59acb7f98bb5d2d6d45f7faa5363939e.gif[/IMG] started working on the game I started in 2013/2014 again restarted from scratch about 7 months ago this is the new world map or menu screen :^)
Am I the only one feeling like WAYWO has been getting slower and slower? :(
[QUOTE=JohnnyOnFlame;52656620]Am I the only one feeling like WAYWO has been getting slower and slower? :([/QUOTE] I think a lot of the old regulars have gotten real lives and real jobs, this thread is kind of dead now. I used to be able to post here a lot without clogging it up (I've averaged exactly one post a day in this shithole for over 7 years straight and I generally only post to WAYWO :v:), now there's often multiple spacegame posts on one page. One of the main reasons I'm still here is just because I'm too ill currently to do anything with my life, I was actually planning to apply for a job at.. well this shithole :v: I think its partly due to the gamedev thread as well, it seems to serve as a separate waywo for stuff that used to be posted here, but its cut an already small community in half. Personally I think it should be merged and everyone redirected back here (because all that content is welcome here, I dunno why people thought it was necessary), but if the community here drops any lower I suspect waywo will just die completely I also think there's probably less influx of newer members because gmod isn't as much of a thing and its likely that there's not an influx of good users to the forum (the rust folks are pretty hitler) Unrelated, all the networking now completely works for my game which is nice [IMG]https://i.imgur.com/WNIstph.png[/IMG] The last thing is allowing an incoming player to pick an empire. Going to do a lot of testing, and start vamping up the battle view after that. Massive lens flare here we come! (its scifi cmon)
Sorry, you need to Log In to post a reply to this thread.